| Index: core/src/fxcodec/codec/codec_int.h
|
| diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h
|
| index 9f408dd9a2d68e3d1ee8c025d141f79876e37050..69fcd054a4113f11d1f4d615786bf08fa90418e5 100644
|
| --- a/core/src/fxcodec/codec/codec_int.h
|
| +++ b/core/src/fxcodec/codec/codec_int.h
|
| @@ -184,7 +184,15 @@ class CCodec_JpegModule : public ICodec_JpegModule {
|
| virtual void* Start();
|
| virtual void Finish(void* pContext);
|
| virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size);
|
| +#ifndef PDF_ENABLE_XFA
|
| virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps);
|
| +#else
|
| + virtual int ReadHeader(void* pContext,
|
| + int* width,
|
| + int* height,
|
| + int* nComps,
|
| + CFX_DIBAttribute* pAttribute = NULL);
|
| +#endif
|
| virtual int StartScanline(void* pContext, int down_scale);
|
| virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf);
|
| virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr);
|
| @@ -192,6 +200,68 @@ class CCodec_JpegModule : public ICodec_JpegModule {
|
| protected:
|
| IFX_JpegProvider* m_pExtProvider;
|
| };
|
| +#ifdef PDF_ENABLE_XFA
|
| +#define PNG_ERROR_SIZE 256
|
| +class CCodec_PngModule : public ICodec_PngModule {
|
| + public:
|
| + CCodec_PngModule() { FXSYS_memset(m_szLastError, '\0', PNG_ERROR_SIZE); }
|
| +
|
| + virtual void* Start(void* pModule);
|
| + virtual void Finish(void* pContext);
|
| + virtual FX_BOOL Input(void* pContext,
|
| + const uint8_t* src_buf,
|
| + FX_DWORD src_size,
|
| + CFX_DIBAttribute* pAttribute);
|
| +
|
| + protected:
|
| + FX_CHAR m_szLastError[PNG_ERROR_SIZE];
|
| +};
|
| +class CCodec_GifModule : public ICodec_GifModule {
|
| + public:
|
| + CCodec_GifModule() { FXSYS_memset(m_szLastError, '\0', 256); }
|
| + virtual void* Start(void* pModule);
|
| + virtual void Finish(void* pContext);
|
| + virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr);
|
| + virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size);
|
| +
|
| + virtual int32_t ReadHeader(void* pContext,
|
| + int* width,
|
| + int* height,
|
| + int* pal_num,
|
| + void** pal_pp,
|
| + int* bg_index,
|
| + CFX_DIBAttribute* pAttribute);
|
| +
|
| + virtual int32_t LoadFrameInfo(void* pContext, int* frame_num);
|
| +
|
| + virtual int32_t LoadFrame(void* pContext,
|
| + int frame_num,
|
| + CFX_DIBAttribute* pAttribute);
|
| +
|
| + protected:
|
| + FX_CHAR m_szLastError[256];
|
| +};
|
| +class CCodec_BmpModule : public ICodec_BmpModule {
|
| + public:
|
| + CCodec_BmpModule() { FXSYS_memset(m_szLastError, '\0', 256); }
|
| + virtual void* Start(void* pModule);
|
| + virtual void Finish(void* pContext);
|
| + virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr);
|
| + virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size);
|
| + virtual int32_t ReadHeader(void* pContext,
|
| + int32_t* width,
|
| + int32_t* height,
|
| + FX_BOOL* tb_flag,
|
| + int32_t* components,
|
| + int32_t* pal_num,
|
| + FX_DWORD** pal_pp,
|
| + CFX_DIBAttribute* pAttribute);
|
| + virtual int32_t LoadImage(void* pContext);
|
| +
|
| + protected:
|
| + FX_CHAR m_szLastError[256];
|
| +};
|
| +#endif
|
| class CCodec_IccModule : public ICodec_IccModule {
|
| public:
|
| virtual IccCS GetProfileCS(const uint8_t* pProfileData,
|
| @@ -267,6 +337,27 @@ class CCodec_JpxModule : public ICodec_JpxModule {
|
| void DestroyDecoder(CJPX_Decoder* pDecoder) override;
|
| };
|
|
|
| +#ifdef PDF_ENABLE_XFA
|
| +class CCodec_TiffModule : public ICodec_TiffModule {
|
| + public:
|
| + // ICodec_TiffModule
|
| + void* CreateDecoder(IFX_FileRead* file_ptr) override;
|
| + void GetFrames(void* ctx, int32_t& frames) override;
|
| + FX_BOOL LoadFrameInfo(void* ctx,
|
| + int32_t frame,
|
| + FX_DWORD& width,
|
| + FX_DWORD& height,
|
| + FX_DWORD& comps,
|
| + FX_DWORD& bpc,
|
| + CFX_DIBAttribute* pAttribute = NULL) override;
|
| + FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) override;
|
| + void DestroyDecoder(void* ctx) override;
|
| +
|
| + protected:
|
| + ~CCodec_TiffModule() override {}
|
| +};
|
| +
|
| +#endif
|
| class CCodec_Jbig2Context {
|
| public:
|
| CCodec_Jbig2Context();
|
| @@ -302,7 +393,9 @@ class CCodec_Jbig2Module : public ICodec_Jbig2Module {
|
| IFX_Pause* pPause) override;
|
| void DestroyJbig2Context(void* pJbig2Context) override;
|
| };
|
| +#ifndef PDF_ENABLE_XFA
|
|
|
| +#endif
|
| struct DecodeData {
|
| public:
|
| DecodeData(unsigned char* src_data, OPJ_SIZE_T src_size)
|
|
|