| 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> |
| 11 #include <list> | 11 #include <list> |
| 12 #include <map> |
| 12 | 13 |
| 13 #include "../../../../third_party/libopenjpeg20/openjpeg.h" // For OPJ_SIZE_T. | 14 #include "../../../../third_party/libopenjpeg20/openjpeg.h" // For OPJ_SIZE_T. |
| 14 #include "../../../include/fxcodec/fx_codec.h" | 15 #include "../../../include/fxcodec/fx_codec.h" |
| 15 #include "../jbig2/JBig2_Context.h" | 16 #include "../jbig2/JBig2_Context.h" |
| 16 | 17 |
| 18 class CFX_IccProfileCache; |
| 19 class CFX_IccTransformCache; |
| 20 |
| 17 class CCodec_BasicModule : public ICodec_BasicModule { | 21 class CCodec_BasicModule : public ICodec_BasicModule { |
| 18 public: | 22 public: |
| 19 virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, | 23 virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf, |
| 20 FX_DWORD src_size, | 24 FX_DWORD src_size, |
| 21 uint8_t*& dest_buf, | 25 uint8_t*& dest_buf, |
| 22 FX_DWORD& dest_size); | 26 FX_DWORD& dest_size); |
| 23 virtual FX_BOOL A85Encode(const uint8_t* src_buf, | 27 virtual FX_BOOL A85Encode(const uint8_t* src_buf, |
| 24 FX_DWORD src_size, | 28 FX_DWORD src_size, |
| 25 uint8_t*& dest_buf, | 29 uint8_t*& dest_buf, |
| 26 FX_DWORD& dest_size); | 30 FX_DWORD& dest_size); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 virtual void TranslateScanline(void* pTransform, | 228 virtual void TranslateScanline(void* pTransform, |
| 225 uint8_t* pDest, | 229 uint8_t* pDest, |
| 226 const uint8_t* pSrc, | 230 const uint8_t* pSrc, |
| 227 int pixels); | 231 int pixels); |
| 228 virtual void SetComponents(FX_DWORD nComponents) { | 232 virtual void SetComponents(FX_DWORD nComponents) { |
| 229 m_nComponents = nComponents; | 233 m_nComponents = nComponents; |
| 230 } | 234 } |
| 231 virtual ~CCodec_IccModule(); | 235 virtual ~CCodec_IccModule(); |
| 232 | 236 |
| 233 protected: | 237 protected: |
| 234 CFX_MapByteStringToPtr m_MapTranform; | 238 enum Icc_CLASS { |
| 235 CFX_MapByteStringToPtr m_MapProfile; | |
| 236 FX_DWORD m_nComponents; | |
| 237 typedef enum { | |
| 238 Icc_CLASS_INPUT = 0, | 239 Icc_CLASS_INPUT = 0, |
| 239 Icc_CLASS_OUTPUT, | 240 Icc_CLASS_OUTPUT, |
| 240 Icc_CLASS_PROOF, | 241 Icc_CLASS_PROOF, |
| 241 Icc_CLASS_MAX | 242 Icc_CLASS_MAX |
| 242 } Icc_CLASS; | 243 }; |
| 243 void* CreateProfile(ICodec_IccModule::IccParam* pIccParam, | 244 void* CreateProfile(ICodec_IccModule::IccParam* pIccParam, |
| 244 Icc_CLASS ic, | 245 Icc_CLASS ic, |
| 245 CFX_BinaryBuf* pTransformKey); | 246 CFX_BinaryBuf* pTransformKey); |
| 247 |
| 248 FX_DWORD m_nComponents; |
| 249 std::map<CFX_ByteString, CFX_IccTransformCache*> m_MapTranform; |
| 250 std::map<CFX_ByteString, CFX_IccProfileCache*> m_MapProfile; |
| 246 }; | 251 }; |
| 247 class CCodec_JpxModule : public ICodec_JpxModule { | 252 class CCodec_JpxModule : public ICodec_JpxModule { |
| 248 public: | 253 public: |
| 249 CCodec_JpxModule(); | 254 CCodec_JpxModule(); |
| 250 void* CreateDecoder(const uint8_t* src_buf, | 255 void* CreateDecoder(const uint8_t* src_buf, |
| 251 FX_DWORD src_size, | 256 FX_DWORD src_size, |
| 252 FX_BOOL useColorSpace = FALSE); | 257 FX_BOOL useColorSpace = FALSE); |
| 253 void GetImageInfo(void* ctx, | 258 void GetImageInfo(void* ctx, |
| 254 FX_DWORD& width, | 259 FX_DWORD& width, |
| 255 FX_DWORD& height, | 260 FX_DWORD& height, |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, | 368 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, |
| 364 OPJ_SIZE_T nb_bytes, | 369 OPJ_SIZE_T nb_bytes, |
| 365 void* p_user_data); | 370 void* p_user_data); |
| 366 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, | 371 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, |
| 367 OPJ_SIZE_T nb_bytes, | 372 OPJ_SIZE_T nb_bytes, |
| 368 void* p_user_data); | 373 void* p_user_data); |
| 369 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 374 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
| 370 OPJ_BOOL opj_seek_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); |
| 371 | 376 |
| 372 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 377 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
| OLD | NEW |