Module decoder

Source

StructsΒ§

Bitfield πŸ”’
Bitfields πŸ”’
BmpDecoder
A bmp decoder
RowIterator πŸ”’

EnumsΒ§

BMPHeaderType πŸ”’
ChannelWidthError πŸ”’
Distinct image types whose saved channel width can be invalid
Chunker πŸ”’
DecoderError πŸ”’
All errors that can occur when attempting to parse a BMP
FormatFullBytes πŸ”’
ImageType πŸ”’
RLEInsn πŸ”’

ConstantsΒ§

BITMAPCOREHEADER_SIZE πŸ”’
BITMAPINFOHEADER_SIZE πŸ”’
BITMAPV2HEADER_SIZE πŸ”’
BITMAPV3HEADER_SIZE πŸ”’
BITMAPV4HEADER_SIZE πŸ”’
BITMAPV5HEADER_SIZE πŸ”’
MAX_WIDTH_HEIGHT πŸ”’
The maximum width/height the decoder will process.
R8_G8_B8_A8_COLOR_MASK πŸ”’
R8_G8_B8_COLOR_MASK πŸ”’
RLE_ESCAPE πŸ”’
RLE_ESCAPE_DELTA πŸ”’
RLE_ESCAPE_EOF πŸ”’
RLE_ESCAPE_EOL πŸ”’

StaticsΒ§

LOOKUP_TABLE_3_BIT_TO_8_BIT πŸ”’
LOOKUP_TABLE_4_BIT_TO_8_BIT πŸ”’
LOOKUP_TABLE_5_BIT_TO_8_BIT πŸ”’
LOOKUP_TABLE_6_BIT_TO_8_BIT πŸ”’
R5_G5_B5_COLOR_MASK πŸ”’

FunctionsΒ§

check_for_overflow πŸ”’
Convenience function to check if the combination of width, length and number of channels would result in a buffer that would overflow.
num_bytes πŸ”’
Calculate how many many bytes a buffer holding a decoded image with these properties would require. Returns None if the buffer size would overflow or if one of the sizes are negative.
set_1bit_pixel_run πŸ”’
set_2bit_pixel_run πŸ”’
set_4bit_pixel_run πŸ”’
set_8bit_pixel_run πŸ”’
with_rows πŸ”’
Call the provided function on each row of the provided buffer, returning Err if the provided function returns an error, extends the buffer if it’s not large enough.