| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CORE_FPDFAPI_PARSER_FPDF_PARSER_DECODE_H_ | 7 #ifndef CORE_FPDFAPI_PARSER_FPDF_PARSER_DECODE_H_ |
| 8 #define CORE_FPDFAPI_PARSER_FPDF_PARSER_DECODE_H_ | 8 #define CORE_FPDFAPI_PARSER_FPDF_PARSER_DECODE_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "core/fxcrt/fx_basic.h" | 12 #include "core/fxcrt/fx_basic.h" |
| 11 | 13 |
| 14 class CCodec_ScanlineDecoder; |
| 12 class CPDF_Dictionary; | 15 class CPDF_Dictionary; |
| 13 | 16 |
| 14 // Indexed by 8-bit char code, contains unicode code points. | 17 // Indexed by 8-bit char code, contains unicode code points. |
| 15 extern const uint16_t PDFDocEncoding[256]; | 18 extern const uint16_t PDFDocEncoding[256]; |
| 16 | 19 |
| 17 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig); | 20 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig); |
| 18 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); | 21 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); |
| 19 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); | 22 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); |
| 20 CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, bool bHex = false); | 23 CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, bool bHex = false); |
| 21 CFX_WideString PDF_DecodeText(const uint8_t* pData, uint32_t size); | 24 CFX_WideString PDF_DecodeText(const uint8_t* pData, uint32_t size); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 38 | 41 |
| 39 uint32_t FlateDecode(const uint8_t* src_buf, | 42 uint32_t FlateDecode(const uint8_t* src_buf, |
| 40 uint32_t src_size, | 43 uint32_t src_size, |
| 41 uint8_t*& dest_buf, | 44 uint8_t*& dest_buf, |
| 42 uint32_t& dest_size); | 45 uint32_t& dest_size); |
| 43 uint32_t RunLengthDecode(const uint8_t* src_buf, | 46 uint32_t RunLengthDecode(const uint8_t* src_buf, |
| 44 uint32_t src_size, | 47 uint32_t src_size, |
| 45 uint8_t*& dest_buf, | 48 uint8_t*& dest_buf, |
| 46 uint32_t& dest_size); | 49 uint32_t& dest_size); |
| 47 | 50 |
| 51 std::unique_ptr<CCodec_ScanlineDecoder> FPDFAPI_CreateFaxDecoder( |
| 52 const uint8_t* src_buf, |
| 53 uint32_t src_size, |
| 54 int width, |
| 55 int height, |
| 56 const CPDF_Dictionary* pParams); |
| 57 |
| 58 std::unique_ptr<CCodec_ScanlineDecoder> FPDFAPI_CreateFlateDecoder( |
| 59 const uint8_t* src_buf, |
| 60 uint32_t src_size, |
| 61 int width, |
| 62 int height, |
| 63 int nComps, |
| 64 int bpc, |
| 65 const CPDF_Dictionary* pParams); |
| 66 |
| 48 // Public for testing. | 67 // Public for testing. |
| 49 uint32_t A85Decode(const uint8_t* src_buf, | 68 uint32_t A85Decode(const uint8_t* src_buf, |
| 50 uint32_t src_size, | 69 uint32_t src_size, |
| 51 uint8_t*& dest_buf, | 70 uint8_t*& dest_buf, |
| 52 uint32_t& dest_size); | 71 uint32_t& dest_size); |
| 53 // Public for testing. | 72 // Public for testing. |
| 54 uint32_t HexDecode(const uint8_t* src_buf, | 73 uint32_t HexDecode(const uint8_t* src_buf, |
| 55 uint32_t src_size, | 74 uint32_t src_size, |
| 56 uint8_t*& dest_buf, | 75 uint8_t*& dest_buf, |
| 57 uint32_t& dest_size); | 76 uint32_t& dest_size); |
| 58 // Public for testing. | 77 // Public for testing. |
| 59 uint32_t FPDFAPI_FlateOrLZWDecode(bool bLZW, | 78 uint32_t FPDFAPI_FlateOrLZWDecode(bool bLZW, |
| 60 const uint8_t* src_buf, | 79 const uint8_t* src_buf, |
| 61 uint32_t src_size, | 80 uint32_t src_size, |
| 62 CPDF_Dictionary* pParams, | 81 CPDF_Dictionary* pParams, |
| 63 uint32_t estimated_size, | 82 uint32_t estimated_size, |
| 64 uint8_t*& dest_buf, | 83 uint8_t*& dest_buf, |
| 65 uint32_t& dest_size); | 84 uint32_t& dest_size); |
| 66 bool PDF_DataDecode(const uint8_t* src_buf, | 85 bool PDF_DataDecode(const uint8_t* src_buf, |
| 67 uint32_t src_size, | 86 uint32_t src_size, |
| 68 const CPDF_Dictionary* pDict, | 87 const CPDF_Dictionary* pDict, |
| 69 uint8_t*& dest_buf, | 88 uint8_t*& dest_buf, |
| 70 uint32_t& dest_size, | 89 uint32_t& dest_size, |
| 71 CFX_ByteString& ImageEncoding, | 90 CFX_ByteString& ImageEncoding, |
| 72 CPDF_Dictionary*& pImageParms, | 91 CPDF_Dictionary*& pImageParms, |
| 73 uint32_t estimated_size, | 92 uint32_t estimated_size, |
| 74 bool bImageAcc); | 93 bool bImageAcc); |
| 75 | 94 |
| 76 #endif // CORE_FPDFAPI_PARSER_FPDF_PARSER_DECODE_H_ | 95 #endif // CORE_FPDFAPI_PARSER_FPDF_PARSER_DECODE_H_ |
| OLD | NEW |