file
parse.c
Enums
- enum gif_extension_type { GIF_GRAPHICS_CONTROL_EXTENSION = 0xF9, GIF_APPLICATION_EXTENSION = 0xFF, GIF_COMMENT_EXTENSION = 0xFE, GIF_TEXT_EXTENSION = 0x01 }
- enum gif_block_type { GIF_EXTENSION_BLOCK = 0x21, GIF_IMAGE_DESCRIPTOR_BLOCK = 0x2C, GIF_TAIL_BLOCK = 0x3B }
Typedefs
-
using gif_extension_type = enum gif_
extension_ type -
using gif_block_type = enum gif_
block_ type
Functions
-
static auto is_gif_file(gif_
parse_ state*const state) -> compare_ result -
static auto is_gif_version_supported(gif_
parse_ state*const state) -> compare_ result -
static auto read_descriptor(gif_
parse_ state*const state) -> gif_ result_ code - static auto skip_block(const uint8_t**const current, size_t*const remaining) -> bool
-
static auto ensure_frame_data(gif_
parse_ state*const state, const size_t frame_index) -> gif_ result_ code -
static auto read_graphics_control_extension(gif_
parse_ state*const state, const size_t frame_index) -> gif_ result_ code - _Static_assert(sizeof(netscape_identifier) = =8U, "The application identifier must be 8 bytes long")
- _Static_assert(sizeof(netscape_auth_code) = =3U, "The application auth code must be 3 bytes long")
-
static auto read_application_extension(gif_
parse_ state*const state) -> gif_ result_ code -
static auto read_extension_block(gif_
parse_ state*const state, const size_t frame_index, bool*const seen_graphics_control_extension) -> gif_ result_ code -
static auto is_frame_size_invalid(const gif_
frame_ descriptor*const descriptor) -> bool -
static auto is_frame_out_of_bounds(const gif_
descriptor*const descriptor, const gif_ frame_ descriptor* frame_descriptor) -> bool -
static auto read_image_descriptor_block(gif_
parse_ state*const state, const size_t frame_index) -> gif_ result_ code -
auto gif_parse_impl(gif_
parse_ state*const state) -> gif_ result_ code
Variables
- static const uint8_t magic
- static const uint8_t gif_version
- static const uint8_t netscape_identifier
- static const uint8_t netscape_auth_code
Defines
- #define CHECK_STATE_REMAINING(value)
- #define LOGICAL_SCREEN_DESCRIPTOR_SIZE
- #define GIF_FRAME_VECTOR_GROWTH
- #define GIF_GRAPHICS_CONTROL_EXTENSION_SIZE
- #define GIF_APPLICATION_EXTENSION_SIZE
- #define GIF_NETSCAPE_SUBBLOCK_SIZE
- #define GIF_NETSCAPE_SUBBLOCK_ID
- #define CONST_CHECK_UN(buffer, code)
- #define GIF_IMAGE_DESCRIPTOR_SIZE
- #define FRAME_CHECK(boolean, code)
- #define CONST_CHECK(predicate, fail_code)