8bit masks use uint16_t for width/height

This commit is contained in:
Raphael Coeffic
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent f07243d47f
commit 4ffc94b88d
2 changed files with 3 additions and 3 deletions
+3 -2
View File
@@ -1268,10 +1268,11 @@ BitmapBuffer * BitmapBuffer::loadMask(const char * filename)
BitmapBuffer* BitmapBuffer::load8bitMask(const uint8_t * lbm)
{
BitmapBuffer * bitmap = new BitmapBuffer(BMP_RGB565,lbm[0],lbm[1]);
const uint16_t* hdr = (const uint16_t*)lbm;
BitmapBuffer * bitmap = new BitmapBuffer(BMP_RGB565,hdr[0],hdr[1]);
if (bitmap) {
pixel_t * p = bitmap->getPixelPtrAbs(0, 0);
const uint8_t * src = lbm + 2;
const uint8_t * src = lbm + 4;
for (int i = bitmap->width() * bitmap->height(); i > 0; i--) {
*((uint8_t *)p) = (*(src++) >> 4);
MOVE_TO_NEXT_RIGHT_PIXEL(p);
-1
View File
@@ -134,7 +134,6 @@ class ImageEncoder:
value = self.get_pixel(image, x, y)
value = 0xFF - value
self.encode_byte(value)
self.f.write("\n")
self.encode_end()
def encode_5_6_5(self, image):