diff options
| author | Mikhail Romanko <me@blankhex.com> | 2025-08-04 12:33:44 +0300 |
|---|---|---|
| committer | Mikhail Romanko <me@blankhex.com> | 2025-08-04 12:38:17 +0300 |
| commit | 0da77c00d652c13a99961d845a0a593dc54f1e49 (patch) | |
| tree | 8a7bef35a1d52dee6613005ccd3e24211cc233f7 /include/BH/Bitmap.h | |
| parent | 9c593932a371d4df6198e04544f214224050cf11 (diff) | |
| download | bhlib-0da77c00d652c13a99961d845a0a593dc54f1e49.tar.gz | |
Refactor bitmap, add new formats
Small refactoring of the bitmap module and added more indexed formats.
Diffstat (limited to 'include/BH/Bitmap.h')
| -rw-r--r-- | include/BH/Bitmap.h | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/include/BH/Bitmap.h b/include/BH/Bitmap.h index b1ec661..8098714 100644 --- a/include/BH/Bitmap.h +++ b/include/BH/Bitmap.h @@ -12,19 +12,22 @@ typedef struct BH_Bitmap BH_Bitmap; #define BH_BITMAP_PREMULT 0x1000 #define BH_BITMAP_NOALPHA 0x2000 #define BH_BITMAP_BGR 0x4000 - - -#define BH_BITMAP_INDEX8 0x0000 -#define BH_BITMAP_GRAY8 0x0001 -#define BH_BITMAP_GRAY16 0x0002 -#define BH_BITMAP_RGBA32 0x0003 -#define BH_BITMAP_RGBA64 0x0004 -#define BH_BITMAP_RGB565 0x8000 -#define BH_BITMAP_RGB888 0x8001 -#define BH_BITMAP_RGBA8888 0x8002 -#define BH_BITMAP_RGB161616 0x8003 -#define BH_BITMAP_RGBA16161616 0x8004 -#define BH_BITMAP_RGBA1010102 0x8005 +#define BH_BITMAP_LSB 0x8000 + +#define BH_BITMAP_INDEX1 0x0000 +#define BH_BITMAP_INDEX2 0x0001 +#define BH_BITMAP_INDEX4 0x0002 +#define BH_BITMAP_INDEX8 0x0003 +#define BH_BITMAP_GRAY8 0x0004 +#define BH_BITMAP_GRAY16 0x0005 +#define BH_BITMAP_RGBA32 0x0006 +#define BH_BITMAP_RGBA64 0x0007 +#define BH_BITMAP_RGB565 0x0008 +#define BH_BITMAP_RGB888 0x0009 +#define BH_BITMAP_RGBA8888 0x000A +#define BH_BITMAP_RGB161616 0x000B +#define BH_BITMAP_RGBA16161616 0x000C +#define BH_BITMAP_RGBA1010102 0x000D #define BH_BITMAP_FLAG_ALIGN32 0x0001 @@ -55,6 +58,17 @@ void BH_BitmapSetColor(BH_Bitmap *bitmap, const BH_Color *value); +uint8_t BH_BitmapIndex(const BH_Bitmap *bitmap, + int x, + int y); + + +void BH_BitmapSetIndex(BH_Bitmap *bitmap, + int x, + int y, + uint8_t index); + + BH_Bitmap *BH_BitmapCopy(BH_Bitmap *bitmap, int x, int y, |
