about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2020-12-14 19:51:37 +0100
committersternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2020-12-14 19:51:37 +0100
commit53385908505cc1694b666a27c09492196c5d232b (patch)
tree44da448e05b0441784ab58e92137ec1387b1e1c5
parent662424e096776f21e2df766068a4b42533a5a554 (diff)
feat(bs_bitmap_new): accept init param like bs_bitmap_extend
-rw-r--r--bitmap.c4
-rw-r--r--include/buchstabensuppe/bitmap.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/bitmap.c b/bitmap.c
index 95d0d77..36db96e 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -71,11 +71,11 @@ bool bs_bitmap_extend(bs_bitmap_t *b, int new_w, int new_h, unsigned char init)
   return false;
 }
 
-bs_bitmap_t bs_bitmap_new(int w, int h) {
+bs_bitmap_t bs_bitmap_new(int w, int h, unsigned char init) {
   bs_bitmap_t b = { NULL, 0, 0 };
 
   if(w > 0 && h > 0) {
-    (void) bs_bitmap_extend(&b, w, h, 0);
+    (void) bs_bitmap_extend(&b, w, h, init);
   }
 
   return b;
diff --git a/include/buchstabensuppe/bitmap.h b/include/buchstabensuppe/bitmap.h
index d17b82b..41d3912 100644
--- a/include/buchstabensuppe/bitmap.h
+++ b/include/buchstabensuppe/bitmap.h
@@ -45,11 +45,11 @@ typedef struct bs_bm_view {
  *
  * Creates a new bitmap with the given width and height.
  * The allocated bitmap is then initialized to hold the
- * value 0 for every pixel.
+ * value `initial` for every pixel.
  *
  * The caller is responsible for freeing the returned bitmap.
  */
-bs_bitmap_t bs_bitmap_new(int width, int height);
+bs_bitmap_t bs_bitmap_new(int width, int height, unsigned char inital);
 
 /*!
  * @brief Free a bitmap's buffer