Refactor bitmap, add RGBA5551 format

This commit is contained in:
2025-08-26 10:40:43 +03:00
parent dd63b19f71
commit 3bba87d8dc
4 changed files with 222 additions and 148 deletions

View File

@@ -25,22 +25,27 @@ typedef struct BH_Bitmap BH_Bitmap;
#define BH_BITMAP_RGBA64 0x000A
#define BH_BITMAP_RGB565 0x000B
#define BH_BITMAP_BGR565 0x000C
#define BH_BITMAP_RGB888 0x000D
#define BH_BITMAP_BGR888 0x000E
#define BH_BITMAP_RGBA8888 0x000F
#define BH_BITMAP_BGRA8888 0x0010
#define BH_BITMAP_ARGB8888 0x0011
#define BH_BITMAP_ABGR8888 0x0012
#define BH_BITMAP_RGB161616 0x0013
#define BH_BITMAP_BGR161616 0x0014
#define BH_BITMAP_RGBA16161616 0x0015
#define BH_BITMAP_BGRA16161616 0x0016
#define BH_BITMAP_ARGB16161616 0x0017
#define BH_BITMAP_ABGR16161616 0x0018
#define BH_BITMAP_RGBA1010102 0x0019
#define BH_BITMAP_BGRA1010102 0x001A
#define BH_BITMAP_ARGB2101010 0x001B
#define BH_BITMAP_ABGR2101010 0x001C
#define BH_BITMAP_RGBA5551 0x000D
#define BH_BITMAP_BGRA5551 0x000E
#define BH_BITMAP_ARGB1555 0x000F
#define BH_BITMAP_ABGR5551 0x0010
#define BH_BITMAP_RGB888 0x0011
#define BH_BITMAP_BGR888 0x0012
#define BH_BITMAP_RGBA8888 0x0013
#define BH_BITMAP_BGRA8888 0x0014
#define BH_BITMAP_ARGB8888 0x0015
#define BH_BITMAP_ABGR8888 0x0016
#define BH_BITMAP_RGB161616 0x0017
#define BH_BITMAP_BGR161616 0x0018
#define BH_BITMAP_RGBA16161616 0x0019
#define BH_BITMAP_BGRA16161616 0x001A
#define BH_BITMAP_ARGB16161616 0x001B
#define BH_BITMAP_ABGR16161616 0x001C
#define BH_BITMAP_RGBA1010102 0x001D
#define BH_BITMAP_BGRA1010102 0x001E
#define BH_BITMAP_ARGB2101010 0x001F
#define BH_BITMAP_ABGR2101010 0x0020
#define BH_BITMAP_FLAG_ALIGN32 0x0001
#define BH_BITMAP_FLAG_EXT_DATA 0x0002
@@ -52,7 +57,8 @@ BH_Bitmap *BH_BitmapNew(uint32_t width,
int format,
int flags,
void *data,
BH_Color *palette);
BH_Color *palette,
int *result);
void BH_BitmapFree(BH_Bitmap *bitmap);
@@ -86,7 +92,8 @@ BH_Bitmap *BH_BitmapCopy(BH_Bitmap *bitmap,
uint32_t y,
uint32_t width,
uint32_t height,
int shallow);
int shallow,
int *result);
void *BH_BitmapScanline(const BH_Bitmap *bitmap,