OLD | NEW |
| (Empty) |
1 // Copyright 2016 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ | |
8 #define CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ | |
9 | |
10 #include "core/fxcrt/include/fx_basic.h" | |
11 | |
12 class CPDF_Dictionary; | |
13 | |
14 // Indexed by 8-bit char code, contains unicode code points. | |
15 extern const uint16_t PDFDocEncoding[256]; | |
16 | |
17 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig); | |
18 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); | |
19 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); | |
20 CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, | |
21 FX_BOOL bHex = FALSE); | |
22 CFX_WideString PDF_DecodeText(const uint8_t* pData, uint32_t size); | |
23 CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr); | |
24 CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1); | |
25 CFX_ByteString PDF_EncodeText(const CFX_WideString& str); | |
26 | |
27 bool FlateEncode(const uint8_t* src_buf, | |
28 uint32_t src_size, | |
29 uint8_t** dest_buf, | |
30 uint32_t* dest_size); | |
31 | |
32 // This used to have more parameters like the predictor and bpc, but there was | |
33 // only one caller, so the interface has been simplified, the values are hard | |
34 // coded, and dead code has been removed. | |
35 bool PngEncode(const uint8_t* src_buf, | |
36 uint32_t src_size, | |
37 uint8_t** dest_buf, | |
38 uint32_t* dest_size); | |
39 | |
40 uint32_t FlateDecode(const uint8_t* src_buf, | |
41 uint32_t src_size, | |
42 uint8_t*& dest_buf, | |
43 uint32_t& dest_size); | |
44 uint32_t RunLengthDecode(const uint8_t* src_buf, | |
45 uint32_t src_size, | |
46 uint8_t*& dest_buf, | |
47 uint32_t& dest_size); | |
48 | |
49 // Public for testing. | |
50 uint32_t A85Decode(const uint8_t* src_buf, | |
51 uint32_t src_size, | |
52 uint8_t*& dest_buf, | |
53 uint32_t& dest_size); | |
54 // Public for testing. | |
55 uint32_t HexDecode(const uint8_t* src_buf, | |
56 uint32_t src_size, | |
57 uint8_t*& dest_buf, | |
58 uint32_t& dest_size); | |
59 // Public for testing. | |
60 uint32_t FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, | |
61 const uint8_t* src_buf, | |
62 uint32_t src_size, | |
63 CPDF_Dictionary* pParams, | |
64 uint32_t estimated_size, | |
65 uint8_t*& dest_buf, | |
66 uint32_t& dest_size); | |
67 FX_BOOL PDF_DataDecode(const uint8_t* src_buf, | |
68 uint32_t src_size, | |
69 const CPDF_Dictionary* pDict, | |
70 uint8_t*& dest_buf, | |
71 uint32_t& dest_size, | |
72 CFX_ByteString& ImageEncoding, | |
73 CPDF_Dictionary*& pImageParms, | |
74 uint32_t estimated_size, | |
75 FX_BOOL bImageAcc); | |
76 | |
77 #endif // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_ | |
OLD | NEW |