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 <limits.h> | 7 #include <limits.h> |
| 8 #include <list> |
| 9 #include "../jbig2/JBig2_Context.h" |
8 class CCodec_BasicModule : public ICodec_BasicModule | 10 class CCodec_BasicModule : public ICodec_BasicModule |
9 { | 11 { |
10 public: | 12 public: |
11 virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_siz
e, FX_LPBYTE& dest_buf, | 13 virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_siz
e, FX_LPBYTE& dest_buf, |
12 FX_DWORD& dest_size); | 14 FX_DWORD& dest_size); |
13 virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_
LPBYTE& dest_buf, | 15 virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_
LPBYTE& dest_buf, |
14 FX_DWORD& dest_size); | 16 FX_DWORD& dest_size); |
15 virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_bu
f, FX_DWORD src_size, int width, int height, | 17 virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_bu
f, FX_DWORD src_size, int width, int height, |
16 int nComps, int bpc); | 18 int nComps, int bpc); |
17 }; | 19 }; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 class CCodec_JpxModule : public ICodec_JpxModule | 191 class CCodec_JpxModule : public ICodec_JpxModule |
190 { | 192 { |
191 public: | 193 public: |
192 CCodec_JpxModule(); | 194 CCodec_JpxModule(); |
193 void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_
BOOL useColorSpace = FALSE); | 195 void* CreateDecoder(FX_LPCBYTE src_buf, FX_DWORD src_size, FX_
BOOL useColorSpace = FALSE); |
194 void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& h
eight, | 196 void GetImageInfo(FX_LPVOID ctx, FX_DWORD& width, FX_DWORD& h
eight, |
195 FX_DWORD& codestream_nComps, FX_DWORD& output_nComp
s); | 197 FX_DWORD& codestream_nComps, FX_DWORD& output_nComp
s); |
196 FX_BOOL Decode(void* ctx, FX_LPBYTE dest_data, int pitch, FX_BOO
L bTranslateColor, FX_LPBYTE offsets); | 198 FX_BOOL Decode(void* ctx, FX_LPBYTE dest_data, int pitch, FX_BOO
L bTranslateColor, FX_LPBYTE offsets); |
197 void DestroyDecoder(void* ctx); | 199 void DestroyDecoder(void* ctx); |
198 }; | 200 }; |
199 #include "../jbig2/JBig2_Context.h" | |
200 class CPDF_Jbig2Interface : public CFX_Object, public CJBig2_Module | 201 class CPDF_Jbig2Interface : public CFX_Object, public CJBig2_Module |
201 { | 202 { |
202 public: | 203 public: |
203 virtual void *JBig2_Malloc(FX_DWORD dwSize) | 204 virtual void *JBig2_Malloc(FX_DWORD dwSize) |
204 { | 205 { |
205 return FX_Alloc(FX_BYTE, dwSize); | 206 return FX_Alloc(FX_BYTE, dwSize); |
206 } | 207 } |
207 virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize) | 208 virtual void *JBig2_Malloc2(FX_DWORD num, FX_DWORD dwSize) |
208 { | 209 { |
209 if (dwSize && num >= UINT_MAX / dwSize) { | 210 if (dwSize && num >= UINT_MAX / dwSize) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LP
BYTE& dest_buf); | 262 FX_DWORD& width, FX_DWORD& height, FX_DWORD& pitch, FX_LP
BYTE& dest_buf); |
262 void* CreateJbig2Context(); | 263 void* CreateJbig2Context(); |
263 FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width,
FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size, | 264 FXCODEC_STATUS StartDecode(void* pJbig2Context, FX_DWORD width,
FX_DWORD height, FX_LPCBYTE src_buf, FX_DWORD src_size, |
264 FX_LPCBYTE global_data, FX_DWORD global_size
, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause); | 265 FX_LPCBYTE global_data, FX_DWORD global_size
, FX_LPBYTE dest_buf, FX_DWORD dest_pitch, IFX_Pause* pPause); |
265 | 266 |
266 FXCODEC_STATUS StartDecode(void* pJbig2Context, IFX_FileRead* f
ile_ptr, | 267 FXCODEC_STATUS StartDecode(void* pJbig2Context, IFX_FileRead* f
ile_ptr, |
267 FX_DWORD& width, FX_DWORD& height, FX_DWORD&
pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause); | 268 FX_DWORD& width, FX_DWORD& height, FX_DWORD&
pitch, FX_LPBYTE& dest_buf, IFX_Pause* pPause); |
268 FXCODEC_STATUS ContinueDecode(void* pJbig2Context, IFX_Pause* p
Pause); | 269 FXCODEC_STATUS ContinueDecode(void* pJbig2Context, IFX_Pause* p
Pause); |
269 void DestroyJbig2Context(void* pJbig2Context)
; | 270 void DestroyJbig2Context(void* pJbig2Context)
; |
270 CPDF_Jbig2Interface m_Module; | 271 CPDF_Jbig2Interface m_Module; |
| 272 std::list<CJBig2_CachePair> m_SymbolDictCache; |
271 private: | 273 private: |
272 }; | 274 }; |
OLD | NEW |