8bit masks use uint16_t for width/height
This commit is contained in:
committed by
Raphael Coeffic
parent
f07243d47f
commit
4ffc94b88d
+3
-2
@@ -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);
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user