fxengine/include/render/bitmap.h

56 lines
1.2 KiB
C
Raw Normal View History

2019-08-28 16:40:40 +02:00
#include <stdint.h>
#include <stdbool.h>
/**
* @brief bitmap rich type
* transparency is in the layout
* @warning Monochrome only !
*/
2019-08-29 14:07:02 +02:00
struct bitmap_rich
2019-08-28 16:40:40 +02:00
{
2019-08-29 14:07:02 +02:00
uint32_t size_px_x;
uint32_t size_px_y;
uint32_t size_o_y;
2019-08-28 16:40:40 +02:00
2019-08-29 14:07:02 +02:00
uint32_t * color;
uint32_t * layout;
2019-08-28 19:55:39 +02:00
};
2019-08-29 14:07:02 +02:00
typedef struct bitmap_rich bitmap_rich;
/**
* @brief get the color of pixel from rich bitmap
*
* @param[in] bmp The bitmap
* @param[in] x The bitmap x coordinate (in pixels)
* @param[in] y The bitmap y coordinate (in pixels)
*
* @return the color coded in a unsigned char :
* if (color >> 1)
* switch (color%2)
* {
* case 0:
* // WHITE
* break;
* case 1:
* // BLACK
* }
* else
*/
2019-08-29 14:07:02 +02:00
inline uint8_t bitmap_get_pixel_r(const bitmap_rich * bmp, uint32_t x, uint32_t y);
/**
* @brief display a specific rich bitmap pixel on the screen
*
* @param[in] bmp The bitmap
* @param[in] bmp_x The bitmap x coordinate (in pixels)
* @param[in] bmp_y The bitmap y coordinate (in pixels)
* @param[in] x screen : x coordinate
* @param[in] y screen : y coordinate
*/
2019-08-29 14:07:02 +02:00
void bitmap_display_pixel_r(const bitmap_rich * bmp, uint32_t bmp_x, uint32_t bmp_y, uint32_t x, uint32_t y);
2019-08-28 19:55:39 +02:00