| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 uint8_t*& dest_buf, | 180 uint8_t*& dest_buf, |
| 181 FX_STRSIZE& dest_size, | 181 FX_STRSIZE& dest_size, |
| 182 int quality, | 182 int quality, |
| 183 const uint8_t* icc_buf, | 183 const uint8_t* icc_buf, |
| 184 FX_DWORD icc_length) override; | 184 FX_DWORD icc_length) override; |
| 185 void* Start() override; | 185 void* Start() override; |
| 186 void Finish(void* pContext) override; | 186 void Finish(void* pContext) override; |
| 187 void Input(void* pContext, | 187 void Input(void* pContext, |
| 188 const uint8_t* src_buf, | 188 const uint8_t* src_buf, |
| 189 FX_DWORD src_size) override; | 189 FX_DWORD src_size) override; |
| 190 #ifndef PDF_ENABLE_XFA |
| 191 int ReadHeader(void* pContext, int* width, int* height, int* nComps) override; |
| 192 #else |
| 190 int ReadHeader(void* pContext, | 193 int ReadHeader(void* pContext, |
| 191 int* width, | 194 int* width, |
| 192 int* height, | 195 int* height, |
| 193 int* nComps, | 196 int* nComps, |
| 194 CFX_DIBAttribute* pAttribute) override; | 197 CFX_DIBAttribute* pAttribute) override; |
| 198 #endif |
| 195 int StartScanline(void* pContext, int down_scale) override; | 199 int StartScanline(void* pContext, int down_scale) override; |
| 196 FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) override; | 200 FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) override; |
| 197 FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override; | 201 FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override; |
| 198 }; | 202 }; |
| 203 #ifdef PDF_ENABLE_XFA |
| 199 #define PNG_ERROR_SIZE 256 | 204 #define PNG_ERROR_SIZE 256 |
| 200 class CCodec_PngModule : public ICodec_PngModule { | 205 class CCodec_PngModule : public ICodec_PngModule { |
| 201 public: | 206 public: |
| 202 CCodec_PngModule() { FXSYS_memset(m_szLastError, '\0', PNG_ERROR_SIZE); } | 207 CCodec_PngModule() { FXSYS_memset(m_szLastError, '\0', PNG_ERROR_SIZE); } |
| 203 | 208 |
| 204 virtual void* Start(void* pModule); | 209 virtual void* Start(void* pModule); |
| 205 virtual void Finish(void* pContext); | 210 virtual void Finish(void* pContext); |
| 206 virtual FX_BOOL Input(void* pContext, | 211 virtual FX_BOOL Input(void* pContext, |
| 207 const uint8_t* src_buf, | 212 const uint8_t* src_buf, |
| 208 FX_DWORD src_size, | 213 FX_DWORD src_size, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 FX_BOOL* tb_flag, | 256 FX_BOOL* tb_flag, |
| 252 int32_t* components, | 257 int32_t* components, |
| 253 int32_t* pal_num, | 258 int32_t* pal_num, |
| 254 FX_DWORD** pal_pp, | 259 FX_DWORD** pal_pp, |
| 255 CFX_DIBAttribute* pAttribute) override; | 260 CFX_DIBAttribute* pAttribute) override; |
| 256 int32_t LoadImage(void* pContext) override; | 261 int32_t LoadImage(void* pContext) override; |
| 257 | 262 |
| 258 protected: | 263 protected: |
| 259 FX_CHAR m_szLastError[256]; | 264 FX_CHAR m_szLastError[256]; |
| 260 }; | 265 }; |
| 266 #endif |
| 261 class CCodec_IccModule : public ICodec_IccModule { | 267 class CCodec_IccModule : public ICodec_IccModule { |
| 262 public: | 268 public: |
| 263 ~CCodec_IccModule() override; | 269 ~CCodec_IccModule() override; |
| 264 | 270 |
| 265 // ICodec_IccModule: | 271 // ICodec_IccModule: |
| 266 IccCS GetProfileCS(const uint8_t* pProfileData, | 272 IccCS GetProfileCS(const uint8_t* pProfileData, |
| 267 unsigned int dwProfileSize) override; | 273 unsigned int dwProfileSize) override; |
| 268 IccCS GetProfileCS(IFX_FileRead* pFile) override; | 274 IccCS GetProfileCS(IFX_FileRead* pFile) override; |
| 269 void* CreateTransform(ICodec_IccModule::IccParam* pInputParam, | 275 void* CreateTransform(ICodec_IccModule::IccParam* pInputParam, |
| 270 ICodec_IccModule::IccParam* pOutputParam, | 276 ICodec_IccModule::IccParam* pOutputParam, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 FX_DWORD* width, | 335 FX_DWORD* width, |
| 330 FX_DWORD* height, | 336 FX_DWORD* height, |
| 331 FX_DWORD* components) override; | 337 FX_DWORD* components) override; |
| 332 bool Decode(CJPX_Decoder* pDecoder, | 338 bool Decode(CJPX_Decoder* pDecoder, |
| 333 uint8_t* dest_data, | 339 uint8_t* dest_data, |
| 334 int pitch, | 340 int pitch, |
| 335 const std::vector<uint8_t>& offsets) override; | 341 const std::vector<uint8_t>& offsets) override; |
| 336 void DestroyDecoder(CJPX_Decoder* pDecoder) override; | 342 void DestroyDecoder(CJPX_Decoder* pDecoder) override; |
| 337 }; | 343 }; |
| 338 | 344 |
| 345 #ifdef PDF_ENABLE_XFA |
| 339 class CCodec_TiffModule : public ICodec_TiffModule { | 346 class CCodec_TiffModule : public ICodec_TiffModule { |
| 340 public: | 347 public: |
| 341 // ICodec_TiffModule | 348 // ICodec_TiffModule |
| 342 void* CreateDecoder(IFX_FileRead* file_ptr) override; | 349 void* CreateDecoder(IFX_FileRead* file_ptr) override; |
| 343 void GetFrames(void* ctx, int32_t& frames) override; | 350 void GetFrames(void* ctx, int32_t& frames) override; |
| 344 FX_BOOL LoadFrameInfo(void* ctx, | 351 FX_BOOL LoadFrameInfo(void* ctx, |
| 345 int32_t frame, | 352 int32_t frame, |
| 346 FX_DWORD& width, | 353 FX_DWORD& width, |
| 347 FX_DWORD& height, | 354 FX_DWORD& height, |
| 348 FX_DWORD& comps, | 355 FX_DWORD& comps, |
| 349 FX_DWORD& bpc, | 356 FX_DWORD& bpc, |
| 350 CFX_DIBAttribute* pAttribute) override; | 357 CFX_DIBAttribute* pAttribute) override; |
| 351 FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) override; | 358 FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) override; |
| 352 void DestroyDecoder(void* ctx) override; | 359 void DestroyDecoder(void* ctx) override; |
| 353 | 360 |
| 354 protected: | 361 protected: |
| 355 ~CCodec_TiffModule() override {} | 362 ~CCodec_TiffModule() override {} |
| 356 }; | 363 }; |
| 357 | 364 |
| 365 #endif |
| 358 class CCodec_Jbig2Context { | 366 class CCodec_Jbig2Context { |
| 359 public: | 367 public: |
| 360 CCodec_Jbig2Context(); | 368 CCodec_Jbig2Context(); |
| 361 ~CCodec_Jbig2Context() {} | 369 ~CCodec_Jbig2Context() {} |
| 362 | 370 |
| 363 FX_DWORD m_width; | 371 FX_DWORD m_width; |
| 364 FX_DWORD m_height; | 372 FX_DWORD m_height; |
| 365 CPDF_StreamAcc* m_pGlobalStream; | 373 CPDF_StreamAcc* m_pGlobalStream; |
| 366 CPDF_StreamAcc* m_pSrcStream; | 374 CPDF_StreamAcc* m_pSrcStream; |
| 367 uint8_t* m_dest_buf; | 375 uint8_t* m_dest_buf; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, | 414 OPJ_SIZE_T opj_read_from_memory(void* p_buffer, |
| 407 OPJ_SIZE_T nb_bytes, | 415 OPJ_SIZE_T nb_bytes, |
| 408 void* p_user_data); | 416 void* p_user_data); |
| 409 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, | 417 OPJ_SIZE_T opj_write_from_memory(void* p_buffer, |
| 410 OPJ_SIZE_T nb_bytes, | 418 OPJ_SIZE_T nb_bytes, |
| 411 void* p_user_data); | 419 void* p_user_data); |
| 412 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 420 OPJ_OFF_T opj_skip_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
| 413 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); | 421 OPJ_BOOL opj_seek_from_memory(OPJ_OFF_T nb_bytes, void* p_user_data); |
| 414 | 422 |
| 415 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ | 423 #endif // CORE_SRC_FXCODEC_CODEC_CODEC_INT_H_ |
| OLD | NEW |