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_INCLUDE_FPDFAPI_FPDF_PARSER_DECODE_H_ | |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_DECODE_H_ | |
9 | |
10 #include "core/include/fxcrt/fx_basic.h" | |
11 | |
12 class CPDF_Dictionary; | |
13 | |
14 // Indexed by 8-bit char code, contains unicode code points. | |
15 extern const FX_WORD 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, FX_DWORD 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 void FlateEncode(const uint8_t* src_buf, | |
28 FX_DWORD src_size, | |
29 uint8_t*& dest_buf, | |
30 FX_DWORD& dest_size); | |
31 void FlateEncode(const uint8_t* src_buf, | |
32 FX_DWORD src_size, | |
33 int predictor, | |
34 int Colors, | |
35 int BitsPerComponent, | |
36 int Columns, | |
37 uint8_t*& dest_buf, | |
38 FX_DWORD& dest_size); | |
39 FX_DWORD FlateDecode(const uint8_t* src_buf, | |
40 FX_DWORD src_size, | |
41 uint8_t*& dest_buf, | |
42 FX_DWORD& dest_size); | |
43 FX_DWORD RunLengthDecode(const uint8_t* src_buf, | |
44 FX_DWORD src_size, | |
45 uint8_t*& dest_buf, | |
46 FX_DWORD& dest_size); | |
47 | |
48 // Public for testing. | |
49 FX_DWORD A85Decode(const uint8_t* src_buf, | |
50 FX_DWORD src_size, | |
51 uint8_t*& dest_buf, | |
52 FX_DWORD& dest_size); | |
53 // Public for testing. | |
54 FX_DWORD HexDecode(const uint8_t* src_buf, | |
55 FX_DWORD src_size, | |
56 uint8_t*& dest_buf, | |
57 FX_DWORD& dest_size); | |
58 // Public for testing. | |
59 FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, | |
60 const uint8_t* src_buf, | |
61 FX_DWORD src_size, | |
62 CPDF_Dictionary* pParams, | |
63 FX_DWORD estimated_size, | |
64 uint8_t*& dest_buf, | |
65 FX_DWORD& dest_size); | |
66 FX_BOOL PDF_DataDecode(const uint8_t* src_buf, | |
67 FX_DWORD src_size, | |
68 const CPDF_Dictionary* pDict, | |
69 uint8_t*& dest_buf, | |
70 FX_DWORD& dest_size, | |
71 CFX_ByteString& ImageEncoding, | |
72 CPDF_Dictionary*& pImageParms, | |
73 FX_DWORD estimated_size, | |
74 FX_BOOL bImageAcc); | |
75 | |
76 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_DECODE_H_ | |
OLD | NEW |