diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-26 16:59:12 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-27 16:10:58 +0000 |
commit | cc3a3ee3ebcc1baabdfa7ffca5876dbbfa3980c1 (patch) | |
tree | 17dfe1c2d050542e883028ead986f017c240e038 /core/fxcodec/lgif/fx_gif.h | |
parent | d6a1595e0bd8f2d0677e2e59e9e0ac6678aaa0d1 (diff) | |
download | pdfium-cc3a3ee3ebcc1baabdfa7ffca5876dbbfa3980c1.tar.xz |
Make names of GIF types less opaque
A lot of the structs in the GIF code use acronyms that are non-obvious
unless you are familar with the GIF spec, and even then lead to lots
of looking back. Making the naming more explicit. Also converted
GifImage to be a struct, since it didn't have any methods defined for
it.
BUG=pdfium:903
Change-Id: I97ca2adfdc4ada8bcaef5f8f317c1dea7365d70d
Reviewed-on: https://pdfium-review.googlesource.com/14836
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcodec/lgif/fx_gif.h')
-rw-r--r-- | core/fxcodec/lgif/fx_gif.h | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/core/fxcodec/lgif/fx_gif.h b/core/fxcodec/lgif/fx_gif.h index bbf847de39..08a64c8326 100644 --- a/core/fxcodec/lgif/fx_gif.h +++ b/core/fxcodec/lgif/fx_gif.h @@ -37,58 +37,57 @@ class CGifContext; #define GIF_D_STATUS_IMG_DATA 0x0A #pragma pack(1) -typedef struct tagGifGF { +typedef struct { uint8_t pal_bits : 3; uint8_t sort_flag : 1; uint8_t color_resolution : 3; uint8_t global_pal : 1; -} GifGF; +} GifGlobalFlags; -typedef struct tagGifLF { +typedef struct { uint8_t pal_bits : 3; uint8_t reserved : 2; uint8_t sort_flag : 1; uint8_t interlace : 1; uint8_t local_pal : 1; -} GifLF; +} GifLocalFlags; -typedef struct tagGifHeader { +typedef struct { char signature[3]; char version[3]; } GifHeader; -typedef struct tagGifLSD { +typedef struct { uint16_t width; uint16_t height; - uint8_t global_flag; + GifGlobalFlags global_flags; uint8_t bc_index; uint8_t pixel_aspect; -} GifLSD; +} GifLocalScreenDescriptor; -typedef struct tagGifImageInfo { +typedef struct { uint16_t left; uint16_t top; uint16_t width; uint16_t height; - - uint8_t local_flag; + GifLocalFlags local_flags; } GifImageInfo; -typedef struct tagGifCEF { +typedef struct { uint8_t transparency : 1; uint8_t user_input : 1; uint8_t disposal_method : 3; uint8_t reserved : 3; -} GifCEF; +} GifControlExtensionFlags; -typedef struct tagGifGCE { +typedef struct { uint8_t block_size; - uint8_t gce_flag; + GifControlExtensionFlags gce_flags; uint16_t delay_time; uint8_t trans_index; -} GifGCE; +} GifGraphicControlExtension; -typedef struct tagGifPTE { +typedef struct { uint8_t block_size; uint16_t grid_left; uint16_t grid_top; @@ -100,15 +99,15 @@ typedef struct tagGifPTE { uint8_t fc_index; uint8_t bc_index; -} GifPTE; +} GifPlainTextExtension; -typedef struct tagGifAE { +typedef struct { uint8_t block_size; uint8_t app_identify[8]; uint8_t app_authentication[3]; -} GifAE; +} GifApplicationExtension; -typedef struct tagGifPalette { uint8_t r, g, b; } GifPalette; +typedef struct { uint8_t r, g, b; } GifPalette; #pragma pack() enum class GifDecodeStatus { @@ -118,12 +117,8 @@ enum class GifDecodeStatus { InsufficientDestSize, // Only used internally by CGifLZWDecoder::Decode() }; -class GifImage { - public: - GifImage(); - ~GifImage(); - - std::unique_ptr<GifGCE> m_ImageGCE; +typedef struct { + std::unique_ptr<GifGraphicControlExtension> m_ImageGCE; std::vector<GifPalette> m_LocalPalettes; std::vector<uint8_t> m_ImageRowBuf; GifImageInfo m_ImageInfo; @@ -131,6 +126,6 @@ class GifImage { uint8_t image_code_exp; uint32_t image_data_pos; int32_t image_row_num; -}; +} GifImage; #endif // CORE_FXCODEC_LGIF_FX_GIF_H_ |