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_ |
| 8 #define CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
| 9 |
7 #include <limits.h> | 10 #include <limits.h> |
8 #include <list> | 11 #include <list> |
| 12 |
| 13 #include "../../../include/fxcodec/fx_codec.h" |
9 #include "../jbig2/JBig2_Context.h" | 14 #include "../jbig2/JBig2_Context.h" |
| 15 #include "../fx_libopenjpeg/libopenjpeg20/openjpeg.h" // For OPJ_SIZE_T. |
| 16 |
10 class CCodec_BasicModule : public ICodec_BasicModule | 17 class CCodec_BasicModule : public ICodec_BasicModule |
11 { | 18 { |
12 public: | 19 public: |
13 virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_siz
e, FX_LPBYTE& dest_buf, | 20 virtual FX_BOOL RunLengthEncode(const FX_BYTE* src_buf, FX_DWORD src_siz
e, FX_LPBYTE& dest_buf, |
14 FX_DWORD& dest_size); | 21 FX_DWORD& dest_size); |
15 virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_
LPBYTE& dest_buf, | 22 virtual FX_BOOL A85Encode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_
LPBYTE& dest_buf, |
16 FX_DWORD& dest_size); | 23 FX_DWORD& dest_size); |
17 virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_bu
f, FX_DWORD src_size, int width, int height, | 24 virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(FX_LPCBYTE src_bu
f, FX_DWORD src_size, int width, int height, |
18 int nComps, int bpc); | 25 int nComps, int bpc); |
19 }; | 26 }; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 FX_LPBYTE m_pExifData; | 359 FX_LPBYTE m_pExifData; |
353 | 360 |
354 FX_DWORD m_dwExifDataLen; | 361 FX_DWORD m_dwExifDataLen; |
355 | 362 |
356 void clear(); | 363 void clear(); |
357 _Read2Bytes m_readWord; | 364 _Read2Bytes m_readWord; |
358 _Read4Bytes m_readDword; | 365 _Read4Bytes m_readDword; |
359 CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE> m_TagHead; | 366 CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE> m_TagHead; |
360 CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE> m_TagVal; | 367 CFX_MapPtrTemplate<FX_DWORD, FX_LPBYTE> m_TagVal; |
361 }; | 368 }; |
| 369 |
| 370 struct DecodeData { |
| 371 public: |
| 372 DecodeData(unsigned char* src_data, OPJ_SIZE_T src_size) : |
| 373 src_data(src_data), src_size(src_size), offset(0) { |
| 374 } |
| 375 unsigned char* src_data; |
| 376 OPJ_SIZE_T src_size; |
| 377 OPJ_SIZE_T offset; |
| 378 }; |
| 379 |
| 380 /* Wrappers for C-style callbacks. */ |
| 381 OPJ_SIZE_T opj_read_from_memory (void* p_buffer, OPJ_SIZE_T nb_bytes, void* p_u
ser_data); |
| 382 OPJ_SIZE_T opj_write_from_memory (void* p_buffer, OPJ_SIZE_T nb_bytes, void* p_u
ser_data); |
| 383 OPJ_OFF_T opj_skip_from_memory (OPJ_OFF_T nb_bytes, void* p_user_data); |
| 384 OPJ_BOOL opj_seek_from_memory (OPJ_OFF_T nb_bytes, void* p_user_data); |
| 385 |
| 386 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
OLD | NEW |