34 #define ECODE_BMP_BASE 0x00000000
38 #define BMP_OK 0x00000000
40 #define BMP_END_OF_FILE
42 #define BMP_ERROR_IO (ECODE_BMP_BASE | 0x0001)
44 #define BMP_ERROR_HEADER_SIZE_MISMATCH (ECODE_BMP_BASE | 0x0002)
46 #define BMP_ERROR_ENDIAN_MISMATCH (ECODE_BMP_BASE | 0x0003)
48 #define BMP_ERROR_FILE_NOT_SUPPORTED (ECODE_BMP_BASE | 0x0004)
50 #define BMP_ERROR_FILE_INVALID (ECODE_BMP_BASE | 0x0005)
52 #define BMP_ERROR_INVALID_ARGUMENT (ECODE_BMP_BASE | 0x0006)
54 #define BMP_ERROR_MODULE_NOT_INITIALIZED (ECODE_BMP_BASE | 0x0007)
56 #define BMP_ERROR_INVALID_PALETTE_SIZE (ECODE_BMP_BASE | 0x0008)
58 #define BMP_ERROR_FILE_NOT_RESET (ECODE_BMP_BASE | 0x0009)
60 #define BMP_ERROR_END_OF_FILE (ECODE_BMP_BASE | 0x0010)
62 #define BMP_ERROR_BUFFER_TOO_SMALL (ECODE_BMP_BASE | 0x0020)
64 #define BMP_ERROR_PALETTE_NOT_READ (ECODE_BMP_BASE | 0x0030)
67 #define BMP_PALETTE_8BIT_SIZE (256 * 4)
69 #define BMP_HEADER_SIZE (54)
71 #define BMP_LOCAL_CACHE_LIMIT (3)
74 #define RLE8_COMPRESSION (1)
76 #define NO_COMPRESSION (0)
79 #define BMP_LOCAL_CACHE_SIZE (BMP_CONFIG_LOCAL_CACHE_SIZE)
83 #if defined ( __GNUC__ )
121 #if defined ( __GNUC__ )
122 } __attribute__ ((__packed__));
155 EMSTATUS
BMP_init(uint8_t *palette, uint32_t paletteSize, EMSTATUS (*fp)(uint8_t buffer[], uint32_t bufLength, uint32_t bytesToRead));
157 EMSTATUS
BMP_readRgbData(uint8_t buffer[], uint32_t bufLength, uint32_t *pixelsRead);
EMSTATUS BMP_reset(void)
Makes the module ready for new bmp file. Reads in header from file, and checks if the provided bmp fi...
struct __BMP_DataType BMP_DataType
BMP Data type structure to hold information about the bmp data returned.
int32_t BMP_getHeight(void)
Get height of BMP image in pixels.
BMP palette structure to hold palette pointer and size.
int32_t BMP_getWidth(void)
Get width of BMP image in pixels.
int32_t BMP_getCompressionType(void)
Get compression type.
int32_t BMP_getFileSize(void)
Get the fileSize in bytes.
int16_t BMP_getBitsPerPixel(void)
Get color depth (bits per pixel)
EMSTATUS BMP_readRawData(BMP_DataType *dataType, uint8_t buffer[], uint32_t bufLength)
Fills buffer with raw data from BMP file.
EMSTATUS BMP_init(uint8_t *palette, uint32_t paletteSize, EMSTATUS(*fp)(uint8_t buffer[], uint32_t bufLength, uint32_t bytesToRead))
Initializes BMP Module.
BMP Data type structure to hold information about the bmp data returned.
int32_t BMP_getImageDataSize(void)
Get imageDataSize in bytes.
int32_t BMP_getDataOffset(void)
Get the offset, i.e. starting address, of the byte where the bitmap data can be found.
EMSTATUS BMP_readRgbData(uint8_t buffer[], uint32_t bufLength, uint32_t *pixelsRead)
Reads in data from BMP file and fills buffer with RGB values. This function terminates either when th...
struct __BMP_Palette BMP_Palette
BMP palette structure to hold palette pointer and size.