fxengine/include/render/bitmap.h

52 lines
1.1 KiB
C

#include <stdint.h>
#include <stdbool.h>
/* bitmap codé bit à bit
0 dans layout -> transparent
1 dans layout -> 1 dans color -> noir
0 dans color -> blanc */
/** bitmap rich type
* @warning Monochrome only !
* transparency is in the layout
*/
struct bitmap_rich
{
uint32_t size_px_x;
uint32_t size_px_y;
uint32_t size_o_y;
uint32_t * color;
uint32_t * layout;
};
typedef struct bitmap_rich bitmap_rich;
/** get the color of pixel from rich bitmap
* @return the color coded in a unsigned char :
* if (color >> 1)
* switch (color%2)
* {
* case 0:
* // WHITE
* break;
* case 1:
* // BLACK
* }
* else
* // TRANSPARENT
* @param the bitmap
* @param x coordinate
* @param y coordinate
*/
inline uint8_t bitmap_get_pixel_r(const bitmap_rich * bmp, uint32_t x, uint32_t y);
/** display a pixel from rich bitmap
* // TRANSPARENT
* @param the bitmap
* @param x coordinate
* @param y coordinate
*/
void bitmap_display_pixel_r(const bitmap_rich * bmp, uint32_t bmp_x, uint32_t bmp_y, uint32_t x, uint32_t y);