Skip to content

Commit dfafab6

Browse files
committed
Enable L8 mode for alphablend
1 parent 8e8c44a commit dfafab6

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

shared-bindings/bitmaptools/__init__.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,11 @@ STATIC mp_obj_t bitmaptools_alphablend(size_t n_args, const mp_obj_t *pos_args,
296296
}
297297

298298
switch (colorspace) {
299-
#if 0
300299
case DISPLAYIO_COLORSPACE_L8:
301300
if (destination->bits_per_value != 8) {
302301
mp_raise_ValueError(translate("For L8 colorspace, input bitmap must have 8 bits per pixel"));
303302
}
304303
break;
305-
#endif
306304

307305
case DISPLAYIO_COLORSPACE_RGB565:
308306
case DISPLAYIO_COLORSPACE_RGB565_SWAPPED:

shared-module/bitmaptools/__init__.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,6 @@ void common_hal_bitmaptools_alphablend(displayio_bitmap_t *dest, displayio_bitma
610610
int ifactor1 = (int)(factor1 * 256);
611611
int ifactor2 = (int)(factor2 * 256);
612612

613-
#if 0
614613
if (colorspace == DISPLAYIO_COLORSPACE_L8) {
615614
for (int y = 0; y < dest->height; y++) {
616615
uint8_t *dptr = (uint8_t *)(dest->data + y * dest->stride);
@@ -622,9 +621,7 @@ void common_hal_bitmaptools_alphablend(displayio_bitmap_t *dest, displayio_bitma
622621
*dptr++ = MIN(255, MAX(0, pixel));
623622
}
624623
}
625-
} else
626-
#endif
627-
{
624+
} else {
628625
bool swap = (colorspace == DISPLAYIO_COLORSPACE_RGB565_SWAPPED) || (colorspace == DISPLAYIO_COLORSPACE_BGR565_SWAPPED);
629626
for (int y = 0; y < dest->height; y++) {
630627
uint16_t *dptr = (uint16_t *)(dest->data + y * dest->stride);

0 commit comments

Comments
 (0)