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

@@ -70,6 +70,10 @@ Currently, the following pixel formats are supported:
64-bit RGB with alpha represented in uint64_t value. The layout is:
0xAAAARRRRGGGGBBBB
=item B<BH_BITMAP_RGBA5551>, B<BH_BITMAP_BGRA5551>, B<BH_BITMAP_ARGB1555>, B<BH_BITMAP_ABGR1555>
16-bit RGB
=item B<BH_BITMAP_RGB565>, B<BH_BITMAP_BGR565>
16-bit RGB
@@ -116,7 +120,8 @@ premultiplied form.
int format,
int flags,
void *data,
BH_Color *palette);
BH_Color *palette,
int *result);
Creates the bitmap with the specified I<width>, I<height> and pixel I<format>.
@@ -134,6 +139,8 @@ The optional I<data> parameter specifies pointer to the existing data.
The optional I<palette> parameter specifies pointer to the existing palette.
The optional parameter I<result> returns 0 or an error code.
This function returns a pointer to a new BH_Bitmap object or NULL.
@@ -198,7 +205,8 @@ The I<x> and I<y> parameters specify a position on the bitmap.
uint32_t y,
uint32_t width,
uint32_t height,
int shallow);
int shallow,
int *result);
Creates a copy of the bitmap region by the given position and size.
@@ -210,6 +218,8 @@ The I<shallow> parameter specifies whether the new bitmap is a shallow copy (or
a view) of the existing bitmap or a deep copy. For the shallow copy to work, the
region should be within the existing bitmap.
The optional parameter I<result> returns 0 or an error code.
This function returns a pointer to a new BH_Bitmap object or NULL.