2019-08-28 20:11:06 +02:00
|
|
|
#include <bitmap.h>
|
|
|
|
|
2019-08-29 10:06:06 +02:00
|
|
|
inline uint8_t bitmap_get_color_8(const bitmap_rich_8 * bmp, uint32_t x, uint32_t y)
|
2019-08-28 20:11:06 +02:00
|
|
|
{
|
2019-08-29 10:06:06 +02:00
|
|
|
if (x >= bmp->size_px_x || y >= bmp->size_px_y)
|
|
|
|
const uint32_t indice = y * bmp.size_o_y + x >> 3;
|
|
|
|
const uint32_t numero_bit = 7 - x % 8;
|
|
|
|
|
|
|
|
return ( bmp.layout[indice] | 1 << numero_bit ) << 1 + ( bmp.color[indice] | 1 << numero_bit );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline uint8_t bitmap_get_color_16(const bitmap_rich_16 * bmp, uint32_t x, uint32_t y)
|
|
|
|
{
|
|
|
|
if (x >= bmp->size_px_x || y >= bmp->size_px_y)
|
|
|
|
const uint32_t indice = y * bmp.size_o_y + x >> 4;
|
|
|
|
const uint32_t numero_bit = 15 - x % 16;
|
|
|
|
|
|
|
|
return ( bmp.layout[indice] | 1 << numero_bit ) << 1 + ( bmp.color[indice] | 1 << numero_bit );
|
|
|
|
}
|
|
|
|
|
|
|
|
inline uint8_t bitmap_get_color_32(const bitmap_rich_32 * bmp, uint32_t x, uint32_t y)
|
|
|
|
{
|
|
|
|
if (x >= bmp->size_px_x || y >= bmp->size_px_y)
|
|
|
|
const uint32_t indice = y * bmp.size_o_y + x >> 5;
|
|
|
|
const uint32_t numero_bit = 31 - x % 32;
|
|
|
|
|
|
|
|
return ( bmp.layout[indice] | 1 << numero_bit ) << 1 + ( bmp.color[indice] | 1 << numero_bit );
|
2019-08-28 20:11:06 +02:00
|
|
|
}
|