50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
#ifndef FE_MODEL_BITMAP
|
|
#define FE_MODEL_BITMAP
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
/* bitmap model
|
|
transparency is in the layout
|
|
this color type is monochrome only ! */
|
|
typedef struct fe_bitmap
|
|
{
|
|
uint32_t size_px_x;
|
|
uint32_t size_px_y;
|
|
uint32_t size_o_y;
|
|
|
|
uint32_t * color;
|
|
bool color_dynamic;
|
|
uint32_t * layout;
|
|
bool layout_dynamic;
|
|
} fe_bitmap;
|
|
|
|
|
|
/* fe_bitmap_new()
|
|
creates a new bitmap in the ram
|
|
with this function, the bmp is dynamic only, but there is still a way tou create it staticly :
|
|
you create a dynamic bmp
|
|
you create a static bmp <fe_bitmap bmp;>
|
|
you do a memcpy*/
|
|
fe_bitmap* fe_bitmap_new(
|
|
uint32_t size_px_x, uint32_t size_px_y, // bitmap size
|
|
uint32_t* color, bool copy_color, // color table address and type (static | dynamic)
|
|
uint32_t *layout, bool copy_layout // layout table address and type (static | dynamic)
|
|
);
|
|
|
|
/* fe_bitmap_del()
|
|
deletes the bitmap from the ram */
|
|
void fe_bitmap_del(fe_bitmap * txtr);
|
|
|
|
|
|
/* fe_bitmap_get_pixel()
|
|
returns the color of a pixel in the gint's type*/
|
|
uint8_t fe_bitmap_get_pixel(const fe_bitmap * txtr, uint32_t x, uint32_t y);
|
|
|
|
|
|
/* fe_bitmap_display_pixel()
|
|
display a specific rich bitmap pixel on the screen (on vram) */
|
|
void fe_bitmap_display_pixel(const fe_bitmap * txtr, uint32_t txtr_x, uint32_t txtr_y, uint32_t x, uint32_t y);
|
|
|
|
#endif
|