diff options
Diffstat (limited to 'core/fxcodec')
-rw-r--r-- | core/fxcodec/codec/ccodec_iccmodule.h | 1 | ||||
-rw-r--r-- | core/fxcodec/codec/fx_codec.cpp | 2 | ||||
-rw-r--r-- | core/fxcodec/codec/fx_codec_icc.cpp | 3 | ||||
-rw-r--r-- | core/fxcodec/include/fx_codec.h | 1 | ||||
-rw-r--r-- | core/fxcodec/lgif/fx_gif.cpp | 19 | ||||
-rw-r--r-- | core/fxcodec/lgif/fx_gif.h | 15 |
6 files changed, 38 insertions, 3 deletions
diff --git a/core/fxcodec/codec/ccodec_iccmodule.h b/core/fxcodec/codec/ccodec_iccmodule.h index 822b202e3f..fd2f456654 100644 --- a/core/fxcodec/codec/ccodec_iccmodule.h +++ b/core/fxcodec/codec/ccodec_iccmodule.h @@ -43,6 +43,7 @@ class CCodec_IccModule { double Gamma; }; + CCodec_IccModule(); ~CCodec_IccModule(); IccCS GetProfileCS(const uint8_t* pProfileData, unsigned int dwProfileSize); diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp index 55cb6ee7fb..1995784dcd 100644 --- a/core/fxcodec/codec/fx_codec.cpp +++ b/core/fxcodec/codec/fx_codec.cpp @@ -31,6 +31,8 @@ CCodec_ModuleMgr::CCodec_ModuleMgr() m_pFlateModule(new CCodec_FlateModule) { } +CCodec_ModuleMgr::~CCodec_ModuleMgr() {} + CCodec_ScanlineDecoder::CCodec_ScanlineDecoder() : m_NextLine(-1), m_pLastScanline(nullptr) {} diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp index 4903c24715..29cfe0e9f4 100644 --- a/core/fxcodec/codec/fx_codec_icc.cpp +++ b/core/fxcodec/codec/fx_codec_icc.cpp @@ -526,6 +526,9 @@ void* CCodec_IccModule::CreateTransform( } return pTransformCache->m_pCmm; } + +CCodec_IccModule::CCodec_IccModule() : m_nComponents(0) {} + CCodec_IccModule::~CCodec_IccModule() { for (const auto& pair : m_MapProfile) { delete pair.second; diff --git a/core/fxcodec/include/fx_codec.h b/core/fxcodec/include/fx_codec.h index 4853e26a6a..8621db2b2c 100644 --- a/core/fxcodec/include/fx_codec.h +++ b/core/fxcodec/include/fx_codec.h @@ -59,6 +59,7 @@ class CFX_DIBAttribute { class CCodec_ModuleMgr { public: CCodec_ModuleMgr(); + ~CCodec_ModuleMgr(); CCodec_BasicModule* GetBasicModule() const { return m_pBasicModule.get(); } CCodec_FaxModule* GetFaxModule() const { return m_pFaxModule.get(); } diff --git a/core/fxcodec/lgif/fx_gif.cpp b/core/fxcodec/lgif/fx_gif.cpp index b9ea090853..d6db28b427 100644 --- a/core/fxcodec/lgif/fx_gif.cpp +++ b/core/fxcodec/lgif/fx_gif.cpp @@ -12,9 +12,28 @@ void CGifLZWDecoder::Input(uint8_t* src_buf, uint32_t src_size) { next_in = src_buf; avail_in = src_size; } + uint32_t CGifLZWDecoder::GetAvailInput() { return avail_in; } + +CGifLZWDecoder::CGifLZWDecoder(FX_CHAR* error_ptr) + : code_size(0), + code_size_cur(0), + code_clear(0), + code_end(0), + code_next(0), + code_first(0), + stack_size(0), + code_old(0), + next_in(nullptr), + avail_in(0), + bits_left(0), + code_store(0), + err_msg_ptr(error_ptr) {} + +CGifLZWDecoder::~CGifLZWDecoder() {} + void CGifLZWDecoder::InitTable(uint8_t code_len) { code_size = code_len; code_clear = 1 << code_size; diff --git a/core/fxcodec/lgif/fx_gif.h b/core/fxcodec/lgif/fx_gif.h index 7d325fb3fe..b7157df429 100644 --- a/core/fxcodec/lgif/fx_gif.h +++ b/core/fxcodec/lgif/fx_gif.h @@ -107,22 +107,25 @@ typedef struct tagGifImage { uint8_t* image_row_buf; int32_t image_row_num; } GifImage; + typedef struct tagGifPlainText { GifGCE* gce_ptr; GifPTE* pte_ptr; CFX_ByteString* string_ptr; } GifPlainText; + class CGifLZWDecoder { public: struct tag_Table { uint16_t prefix; uint8_t suffix; }; - CGifLZWDecoder(FX_CHAR* error_ptr = nullptr) { err_msg_ptr = error_ptr; } - void InitTable(uint8_t code_len); - int32_t Decode(uint8_t* des_buf, uint32_t& des_size); + explicit CGifLZWDecoder(FX_CHAR* error_ptr); + ~CGifLZWDecoder(); + void InitTable(uint8_t code_len); + int32_t Decode(uint8_t* des_buf, uint32_t& des_size); void Input(uint8_t* src_buf, uint32_t src_size); uint32_t GetAvailInput(); @@ -130,6 +133,7 @@ class CGifLZWDecoder { void ClearTable(); void AddCode(uint16_t prefix_code, uint8_t append_char); void DecodeString(uint16_t code); + uint8_t code_size; uint8_t code_size_cur; uint16_t code_clear; @@ -149,14 +153,17 @@ class CGifLZWDecoder { FX_CHAR* err_msg_ptr; }; + class CGifLZWEncoder { public: struct tag_Table { uint16_t prefix; uint8_t suffix; }; + CGifLZWEncoder(); ~CGifLZWEncoder(); + void Start(uint8_t code_len, const uint8_t* src_buf, uint8_t*& dst_buf, @@ -178,6 +185,7 @@ class CGifLZWEncoder { uint32_t& dst_len, uint32_t& offset); void WriteBlock(uint8_t*& dst_buf, uint32_t& dst_len, uint32_t& offset); + jmp_buf jmp; uint32_t src_offset; uint8_t src_bit_offset; @@ -194,6 +202,7 @@ class CGifLZWEncoder { tag_Table code_table[GIF_MAX_LZW_CODE]; uint16_t table_cur; }; + typedef struct tag_gif_decompress_struct gif_decompress_struct; typedef gif_decompress_struct* gif_decompress_struct_p; typedef gif_decompress_struct_p* gif_decompress_struct_pp; |