add sp_bitmap_into_bitvec, sp_bitmap_from_bitvec

This commit is contained in:
Vinzenz Schroeter 2025-04-12 18:35:48 +02:00
parent fd6f9198f3
commit 0af8ea98dd
2 changed files with 42 additions and 1 deletions

View file

@ -388,6 +388,15 @@ void sp_bitmap_fill(Bitmap */*notnull*/ bitmap, bool value);
*/
void sp_bitmap_free(Bitmap */*notnull*/ bitmap);
/**
* Tries to convert the BitVec to a Bitmap.
*
* The provided BitVec gets consumed.
*
* Returns NULL in case of error.
*/
Bitmap *sp_bitmap_from_bitvec(size_t width, SPBitVec */*notnull*/ bitvec);
/**
* Gets the current value at the specified position in the [Bitmap].
*
@ -411,6 +420,11 @@ bool sp_bitmap_get(Bitmap */*notnull*/ bitmap, size_t x, size_t y);
*/
size_t sp_bitmap_height(Bitmap */*notnull*/ bitmap);
/**
* Consumes the Bitmap and returns the contained BitVec
*/
SPBitVec */*notnull*/ sp_bitmap_into_bitvec(Bitmap */*notnull*/ bitmap);
/**
* Loads a [Bitmap] with the specified dimensions from the provided data.
*