summaryrefslogtreecommitdiff
path: root/core/fxcodec/lgif/fx_gif.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-05-02 10:45:35 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-02 15:19:03 +0000
commitec3a9e27d9e37ef9074c0097481d4a9dfd57549f (patch)
treea9038b373d05260bab6145526f61bdfa2b4d9a20 /core/fxcodec/lgif/fx_gif.h
parentea23e0a2d6540d6fbc03ebc74e1e6c17dc254f32 (diff)
downloadpdfium-ec3a9e27d9e37ef9074c0097481d4a9dfd57549f.tar.xz
Fix some nits in fx_gif.cpp
Change-Id: I7d2d731b8b18d315b5587e1d0d9737c08cbcdead Reviewed-on: https://pdfium-review.googlesource.com/4710 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec/lgif/fx_gif.h')
-rw-r--r--core/fxcodec/lgif/fx_gif.h93
1 files changed, 1 insertions, 92 deletions
diff --git a/core/fxcodec/lgif/fx_gif.h b/core/fxcodec/lgif/fx_gif.h
index 5027c447d5..a77a8a3065 100644
--- a/core/fxcodec/lgif/fx_gif.h
+++ b/core/fxcodec/lgif/fx_gif.h
@@ -126,7 +126,7 @@ class CGifLZWDecoder {
~CGifLZWDecoder();
void InitTable(uint8_t code_len);
- int32_t Decode(uint8_t* des_buf, uint32_t& des_size);
+ int32_t Decode(uint8_t* des_buf, uint32_t* des_size);
void Input(uint8_t* src_buf, uint32_t src_size);
uint32_t GetAvailInput();
@@ -155,53 +155,6 @@ class CGifLZWDecoder {
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,
- uint32_t& offset);
- bool Encode(const uint8_t* src_buf,
- uint32_t src_len,
- uint8_t*& dst_buf,
- uint32_t& dst_len,
- uint32_t& offset);
- void Finish(uint8_t*& dst_buf, uint32_t& dst_len, uint32_t& offset);
-
- private:
- void ClearTable();
- bool LookUpInTable(const uint8_t* buf, uint32_t& offset, uint8_t& bit_offset);
- void EncodeString(uint32_t index,
- uint8_t*& dst_buf,
- 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;
- uint8_t src_bit_cut;
- uint32_t src_bit_num;
- uint8_t code_size;
- uint16_t code_clear;
- uint16_t code_end;
- uint16_t index_num;
- uint8_t bit_offset;
- uint8_t index_bit_cur;
- uint8_t index_buf[GIF_DATA_BLOCK];
- uint8_t index_buf_len;
- 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;
@@ -253,61 +206,17 @@ struct tag_gif_decompress_struct {
GifGCE* gce_ptr;
std::vector<GifPlainText*>* pt_ptr_arr_ptr;
};
-typedef struct tag_gif_compress_struct gif_compress_struct;
-typedef gif_compress_struct* gif_compress_struct_p;
-typedef gif_compress_struct_p* gif_compress_struct_pp;
-struct tag_gif_compress_struct {
- const uint8_t* src_buf;
- uint32_t src_pitch;
- uint32_t src_width;
- uint32_t src_row;
- uint32_t cur_offset;
- uint32_t frames;
- GifHeader* header_ptr;
- GifLSD* lsd_ptr;
- GifPalette* global_pal;
- uint16_t gpal_num;
- GifPalette* local_pal;
- uint16_t lpal_num;
- GifImageInfo* image_info_ptr;
- CGifLZWEncoder* img_encoder_ptr;
-
- uint8_t* cmt_data_ptr;
- uint32_t cmt_data_len;
- GifGCE* gce_ptr;
- GifPTE* pte_ptr;
- const uint8_t* pte_data_ptr;
- uint32_t pte_data_len;
-};
-void gif_error(gif_decompress_struct_p gif_ptr, const char* err_msg);
-void gif_warn(gif_decompress_struct_p gif_ptr, const char* err_msg);
gif_decompress_struct_p gif_create_decompress();
void gif_destroy_decompress(gif_decompress_struct_pp gif_ptr_ptr);
-gif_compress_struct_p gif_create_compress();
-void gif_destroy_compress(gif_compress_struct_pp gif_ptr_ptr);
int32_t gif_read_header(gif_decompress_struct_p gif_ptr);
int32_t gif_get_frame(gif_decompress_struct_p gif_ptr);
int32_t gif_get_frame_num(gif_decompress_struct_p gif_ptr);
-int32_t gif_decode_extension(gif_decompress_struct_p gif_ptr);
-int32_t gif_decode_image_info(gif_decompress_struct_p gif_ptr);
-void gif_takeover_gce_ptr(gif_decompress_struct_p gif_ptr,
- GifGCE** gce_ptr_ptr);
int32_t gif_load_frame(gif_decompress_struct_p gif_ptr, int32_t frame_num);
-uint8_t* gif_read_data(gif_decompress_struct_p gif_ptr,
- uint8_t** des_buf_pp,
- uint32_t data_size);
-void gif_decoding_failure_at_tail_cleanup(gif_decompress_struct_p gif_ptr,
- GifImage* gif_image_ptr);
-void gif_save_decoding_status(gif_decompress_struct_p gif_ptr, int32_t status);
void gif_input_buffer(gif_decompress_struct_p gif_ptr,
uint8_t* src_buf,
uint32_t src_size);
uint32_t gif_get_avail_input(gif_decompress_struct_p gif_ptr,
uint8_t** avail_buf_ptr);
-void interlace_buf(const uint8_t* buf, uint32_t width, uint32_t height);
-bool gif_encode(gif_compress_struct_p gif_ptr,
- uint8_t*& dst_buf,
- uint32_t& dst_len);
#endif // CORE_FXCODEC_LGIF_FX_GIF_H_