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 #ifndef CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 7 #ifndef CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
8 #define CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 8 #define CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
9 | 9 |
10 #include <limits.h> | 10 #include <limits.h> |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 void DestroyDecoder(CJPX_Decoder* pDecoder) override; | 267 void DestroyDecoder(CJPX_Decoder* pDecoder) override; |
268 }; | 268 }; |
269 | 269 |
270 class CCodec_Jbig2Context { | 270 class CCodec_Jbig2Context { |
271 public: | 271 public: |
272 CCodec_Jbig2Context(); | 272 CCodec_Jbig2Context(); |
273 ~CCodec_Jbig2Context() {} | 273 ~CCodec_Jbig2Context() {} |
274 | 274 |
275 FX_DWORD m_width; | 275 FX_DWORD m_width; |
276 FX_DWORD m_height; | 276 FX_DWORD m_height; |
277 uint8_t* m_src_buf; | 277 CPDF_StreamAcc* m_pGlobalStream; |
278 FX_DWORD m_src_size; | 278 CPDF_StreamAcc* m_pSrcStream; |
279 const uint8_t* m_global_data; | |
280 FX_DWORD m_global_size; | |
281 uint8_t* m_dest_buf; | 279 uint8_t* m_dest_buf; |
282 FX_DWORD m_dest_pitch; | 280 FX_DWORD m_dest_pitch; |
283 FX_BOOL m_bFileReader; | |
Lei Zhang
2015/10/06 22:40:23
If you want to spin this off into its own separate
David Lattimore
2015/10/07 22:41:53
Done.
| |
284 IFX_Pause* m_pPause; | 281 IFX_Pause* m_pPause; |
285 CJBig2_Context* m_pContext; | 282 CJBig2_Context* m_pContext; |
286 CJBig2_Image* m_dest_image; | 283 CJBig2_Image* m_dest_image; |
287 }; | 284 }; |
288 class CCodec_Jbig2Module : public ICodec_Jbig2Module { | 285 class CCodec_Jbig2Module : public ICodec_Jbig2Module { |
289 public: | 286 public: |
290 CCodec_Jbig2Module() {} | 287 CCodec_Jbig2Module() {} |
291 ~CCodec_Jbig2Module() override; | 288 ~CCodec_Jbig2Module() override; |
292 | 289 |
293 // ICodec_Jbig2Module | 290 // ICodec_Jbig2Module |
294 void* CreateJbig2Context() override; | 291 void* CreateJbig2Context() override; |
295 FXCODEC_STATUS StartDecode(void* pJbig2Context, | 292 FXCODEC_STATUS StartDecode(void* pJbig2Context, |
293 CFX_PrivateData* pPrivateData, | |
296 FX_DWORD width, | 294 FX_DWORD width, |
297 FX_DWORD height, | 295 FX_DWORD height, |
298 const uint8_t* src_buf, | 296 CPDF_StreamAcc* src_stream, |
299 FX_DWORD src_size, | 297 CPDF_StreamAcc* global_stream, |
300 const uint8_t* global_data, | |
301 FX_DWORD global_size, | |
302 uint8_t* dest_buf, | 298 uint8_t* dest_buf, |
303 FX_DWORD dest_pitch, | 299 FX_DWORD dest_pitch, |
304 IFX_Pause* pPause) override; | 300 IFX_Pause* pPause) override; |
305 FXCODEC_STATUS ContinueDecode(void* pJbig2Context, | 301 FXCODEC_STATUS ContinueDecode(void* pJbig2Context, |
306 IFX_Pause* pPause) override; | 302 IFX_Pause* pPause) override; |
307 void DestroyJbig2Context(void* pJbig2Context) override; | 303 void DestroyJbig2Context(void* pJbig2Context) override; |
308 | |
309 private: | |
310 std::list<CJBig2_CachePair> m_SymbolDictCache; | |
311 }; | 304 }; |
312 | 305 |
313 struct DecodeData { | 306 struct DecodeData { |
314 public: | 307 public: |
315 DecodeData(unsigned char* src_data, OPJ_SIZE_T src_size) | 308 DecodeData(unsigned char* src_data, OPJ_SIZE_T src_size) |
316 : src_data(src_data), src_size(src_size), offset(0) {} | 309 : src_data(src_data), src_size(src_size), offset(0) {} |
317 unsigned char* src_data; | 310 unsigned char* src_data; |
318 OPJ_SIZE_T src_size; | 311 OPJ_SIZE_T src_size; |
319 OPJ_SIZE_T offset; | 312 OPJ_SIZE_T offset; |
320 }; | 313 }; |
321 | 314 |
322 /* Wrappers for C-style callbacks. */ | 315 /* Wrappers for C-style callbacks. */ |
323 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, | 316 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, |
324 OPJ_SIZE_T nb_bytes, | 317 OPJ_SIZE_T nb_bytes, |
325 void* p_user_data); | 318 void* p_user_data); |
326 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, | 319 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, |
327 OPJ_SIZE_T nb_bytes, | 320 OPJ_SIZE_T nb_bytes, |
328 void* p_user_data); | 321 void* p_user_data); |
329 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 322 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
330 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 323 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
331 | 324 |
332 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 325 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
OLD | NEW |