OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fxcodec/codec/codec_int.h" | 7 #include "core/fxcodec/codec/codec_int.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 void Create(const uint8_t* src_buf, | 743 void Create(const uint8_t* src_buf, |
744 uint32_t src_size, | 744 uint32_t src_size, |
745 int width, | 745 int width, |
746 int height, | 746 int height, |
747 int nComps, | 747 int nComps, |
748 int bpc, | 748 int bpc, |
749 int predictor, | 749 int predictor, |
750 int Colors, | 750 int Colors, |
751 int BitsPerComponent, | 751 int BitsPerComponent, |
752 int Columns); | 752 int Columns); |
753 void Destroy() { delete this; } | |
754 | 753 |
755 // CCodec_ScanlineDecoder | 754 // CCodec_ScanlineDecoder |
756 FX_BOOL v_Rewind() override; | 755 FX_BOOL v_Rewind() override; |
757 uint8_t* v_GetNextLine() override; | 756 uint8_t* v_GetNextLine() override; |
758 uint32_t GetSrcOffset() override; | 757 uint32_t GetSrcOffset() override; |
759 | 758 |
760 void* m_pFlate; | 759 void* m_pFlate; |
761 const uint8_t* m_SrcBuf; | 760 const uint8_t* m_SrcBuf; |
762 uint32_t m_SrcSize; | 761 uint32_t m_SrcSize; |
763 uint8_t* m_pScanline; | 762 uint8_t* m_pScanline; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 uint32_t src_size, | 996 uint32_t src_size, |
998 uint8_t*& dest_buf, | 997 uint8_t*& dest_buf, |
999 uint32_t& dest_size) { | 998 uint32_t& dest_size) { |
1000 dest_size = src_size + src_size / 1000 + 12; | 999 dest_size = src_size + src_size / 1000 + 12; |
1001 dest_buf = FX_Alloc(uint8_t, dest_size); | 1000 dest_buf = FX_Alloc(uint8_t, dest_size); |
1002 unsigned long temp_size = dest_size; | 1001 unsigned long temp_size = dest_size; |
1003 FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size); | 1002 FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size); |
1004 dest_size = (uint32_t)temp_size; | 1003 dest_size = (uint32_t)temp_size; |
1005 return TRUE; | 1004 return TRUE; |
1006 } | 1005 } |
OLD | NEW |