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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 IFX_Pause* m_pPause; | 308 IFX_Pause* m_pPause; |
309 CJBig2_Context* m_pContext; | 309 CJBig2_Context* m_pContext; |
310 CJBig2_Image* m_dest_image; | 310 CJBig2_Image* m_dest_image; |
311 }; | 311 }; |
312 class CCodec_Jbig2Module : public ICodec_Jbig2Module { | 312 class CCodec_Jbig2Module : public ICodec_Jbig2Module { |
313 public: | 313 public: |
314 CCodec_Jbig2Module() {} | 314 CCodec_Jbig2Module() {} |
315 ~CCodec_Jbig2Module() override; | 315 ~CCodec_Jbig2Module() override; |
316 | 316 |
317 // ICodec_Jbig2Module | 317 // ICodec_Jbig2Module |
318 FX_BOOL Decode(FX_DWORD width, | |
319 FX_DWORD height, | |
320 const uint8_t* src_buf, | |
321 FX_DWORD src_size, | |
322 const uint8_t* global_data, | |
323 FX_DWORD global_size, | |
324 uint8_t* dest_buf, | |
325 FX_DWORD dest_pitch) override; | |
326 FX_BOOL Decode(IFX_FileRead* file_ptr, | |
327 FX_DWORD& width, | |
328 FX_DWORD& height, | |
329 FX_DWORD& pitch, | |
330 uint8_t*& dest_buf) override; | |
331 void* CreateJbig2Context() override; | 318 void* CreateJbig2Context() override; |
332 FXCODEC_STATUS StartDecode(void* pJbig2Context, | 319 FXCODEC_STATUS StartDecode(void* pJbig2Context, |
333 FX_DWORD width, | 320 FX_DWORD width, |
334 FX_DWORD height, | 321 FX_DWORD height, |
335 const uint8_t* src_buf, | 322 const uint8_t* src_buf, |
336 FX_DWORD src_size, | 323 FX_DWORD src_size, |
337 const uint8_t* global_data, | 324 const uint8_t* global_data, |
338 FX_DWORD global_size, | 325 FX_DWORD global_size, |
339 uint8_t* dest_buf, | 326 uint8_t* dest_buf, |
340 FX_DWORD dest_pitch, | 327 FX_DWORD dest_pitch, |
341 IFX_Pause* pPause) override; | 328 IFX_Pause* pPause) override; |
342 FXCODEC_STATUS StartDecode(void* pJbig2Context, | |
343 IFX_FileRead* file_ptr, | |
344 FX_DWORD& width, | |
345 FX_DWORD& height, | |
346 FX_DWORD& pitch, | |
347 uint8_t*& dest_buf, | |
348 IFX_Pause* pPause) override; | |
349 FXCODEC_STATUS ContinueDecode(void* pJbig2Context, | 329 FXCODEC_STATUS ContinueDecode(void* pJbig2Context, |
350 IFX_Pause* pPause) override; | 330 IFX_Pause* pPause) override; |
351 void DestroyJbig2Context(void* pJbig2Context) override; | 331 void DestroyJbig2Context(void* pJbig2Context) override; |
352 | 332 |
353 private: | 333 private: |
354 CPDF_Jbig2Interface m_Module; | 334 CPDF_Jbig2Interface m_Module; |
355 std::list<CJBig2_CachePair> m_SymbolDictCache; | 335 std::list<CJBig2_CachePair> m_SymbolDictCache; |
356 }; | 336 }; |
357 | 337 |
358 struct DecodeData { | 338 struct DecodeData { |
359 public: | 339 public: |
360 DecodeData(unsigned char* src_data, OPJ_SIZE_T src_size) | 340 DecodeData(unsigned char* src_data, OPJ_SIZE_T src_size) |
361 : src_data(src_data), src_size(src_size), offset(0) {} | 341 : src_data(src_data), src_size(src_size), offset(0) {} |
362 unsigned char* src_data; | 342 unsigned char* src_data; |
363 OPJ_SIZE_T src_size; | 343 OPJ_SIZE_T src_size; |
364 OPJ_SIZE_T offset; | 344 OPJ_SIZE_T offset; |
365 }; | 345 }; |
366 | 346 |
367 /* Wrappers for C-style callbacks. */ | 347 /* Wrappers for C-style callbacks. */ |
368 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, | 348 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, |
369 OPJ_SIZE_T nb_bytes, | 349 OPJ_SIZE_T nb_bytes, |
370 void* p_user_data); | 350 void* p_user_data); |
371 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, | 351 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, |
372 OPJ_SIZE_T nb_bytes, | 352 OPJ_SIZE_T nb_bytes, |
373 void* p_user_data); | 353 void* p_user_data); |
374 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 354 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
375 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 355 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
376 | 356 |
377 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 357 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
OLD | NEW |