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_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ |
8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ | 8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_basic.h" | 10 #include "core/fxcrt/include/fx_basic.h" |
11 | 11 |
12 class CPDF_Dictionary; | 12 class CPDF_Dictionary; |
13 | 13 |
14 // Indexed by 8-bit char code, contains unicode code points. | 14 // Indexed by 8-bit char code, contains unicode code points. |
15 extern const uint16_t PDFDocEncoding[256]; | 15 extern const uint16_t PDFDocEncoding[256]; |
16 | 16 |
17 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig); | 17 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig); |
18 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); | 18 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); |
19 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); | 19 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); |
20 CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, | 20 CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, |
21 FX_BOOL bHex = FALSE); | 21 FX_BOOL bHex = FALSE); |
22 CFX_WideString PDF_DecodeText(const uint8_t* pData, uint32_t size); | 22 CFX_WideString PDF_DecodeText(const uint8_t* pData, uint32_t size); |
23 CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr); | 23 CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr); |
24 CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1); | 24 CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1); |
25 CFX_ByteString PDF_EncodeText(const CFX_WideString& str); | 25 CFX_ByteString PDF_EncodeText(const CFX_WideString& str); |
26 | 26 |
27 void FlateEncode(const uint8_t* src_buf, | 27 bool FlateEncode(const uint8_t* src_buf, |
28 uint32_t src_size, | 28 uint32_t src_size, |
29 uint8_t*& dest_buf, | 29 uint8_t** dest_buf, |
30 uint32_t& dest_size); | 30 uint32_t* dest_size); |
31 void FlateEncode(const uint8_t* src_buf, | 31 |
32 uint32_t src_size, | 32 // This used to have more parameters like the predictor and bpc, but there was |
33 int predictor, | 33 // only one caller, so the interface has been simplified, the values are hard |
34 int Colors, | 34 // coded, and dead code has been removed. |
35 int BitsPerComponent, | 35 bool PngEncode(const uint8_t* src_buf, |
36 int Columns, | 36 uint32_t src_size, |
37 uint8_t*& dest_buf, | 37 uint8_t** dest_buf, |
38 uint32_t& dest_size); | 38 uint32_t* dest_size); |
| 39 |
39 uint32_t FlateDecode(const uint8_t* src_buf, | 40 uint32_t FlateDecode(const uint8_t* src_buf, |
40 uint32_t src_size, | 41 uint32_t src_size, |
41 uint8_t*& dest_buf, | 42 uint8_t*& dest_buf, |
42 uint32_t& dest_size); | 43 uint32_t& dest_size); |
43 uint32_t RunLengthDecode(const uint8_t* src_buf, | 44 uint32_t RunLengthDecode(const uint8_t* src_buf, |
44 uint32_t src_size, | 45 uint32_t src_size, |
45 uint8_t*& dest_buf, | 46 uint8_t*& dest_buf, |
46 uint32_t& dest_size); | 47 uint32_t& dest_size); |
47 | 48 |
48 // Public for testing. | 49 // Public for testing. |
(...skipping 18 matching lines...) Expand all Loading... |
67 uint32_t src_size, | 68 uint32_t src_size, |
68 const CPDF_Dictionary* pDict, | 69 const CPDF_Dictionary* pDict, |
69 uint8_t*& dest_buf, | 70 uint8_t*& dest_buf, |
70 uint32_t& dest_size, | 71 uint32_t& dest_size, |
71 CFX_ByteString& ImageEncoding, | 72 CFX_ByteString& ImageEncoding, |
72 CPDF_Dictionary*& pImageParms, | 73 CPDF_Dictionary*& pImageParms, |
73 uint32_t estimated_size, | 74 uint32_t estimated_size, |
74 FX_BOOL bImageAcc); | 75 FX_BOOL bImageAcc); |
75 | 76 |
76 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ | 77 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ |
OLD | NEW |