mirror of
https://github.com/pocketpy/pocketpy
synced 2025-12-08 11:10:16 +00:00
Update cute_png.c
This commit is contained in:
parent
cc95299cb4
commit
f95b765207
@ -159,8 +159,9 @@ static bool cute_png_Image__to_rgb565_bytes(int argc, py_Ref argv) {
|
|||||||
uint16_t g = (pixel.g >> 2) & 0x3F;
|
uint16_t g = (pixel.g >> 2) & 0x3F;
|
||||||
uint16_t b = (pixel.b >> 3) & 0x1F;
|
uint16_t b = (pixel.b >> 3) & 0x1F;
|
||||||
uint16_t rgb565 = (r << 11) | (g << 5) | b;
|
uint16_t rgb565 = (r << 11) | (g << 5) | b;
|
||||||
data[idx * 2 + 0] = (rgb565 >> 8) & 0xFF;
|
// use little-endian
|
||||||
data[idx * 2 + 1] = (rgb565 >> 0) & 0xFF;
|
data[idx * 2 + 0] = rgb565 & 0xFF;
|
||||||
|
data[idx * 2 + 1] = (rgb565 >> 8) & 0xFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user