Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Hosted Weblate 2021-06-30 19:19:30 +02:00
commit f3cde244e8
No known key found for this signature in database
GPG Key ID: A3FAAA06E6569B4C
4 changed files with 34 additions and 5 deletions

View File

@ -147,11 +147,6 @@ msgstr ""
msgid "%q must of type %q" msgid "%q must of type %q"
msgstr "" msgstr ""
#: shared-bindings/keypad/KeyMatrix.c shared-bindings/keypad/Keys.c
#: shared-bindings/keypad/ShiftRegisterKeys.c
msgid "%q must store bytes"
msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#: shared-bindings/canio/Match.c #: shared-bindings/canio/Match.c
msgid "%q out of range" msgid "%q out of range"

View File

@ -70,6 +70,10 @@ MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, RGB565, DISPLAY
MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, RGB565_SWAPPED, DISPLAYIO_COLORSPACE_RGB565_SWAPPED); MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, RGB565_SWAPPED, DISPLAYIO_COLORSPACE_RGB565_SWAPPED);
MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, RGB555, DISPLAYIO_COLORSPACE_RGB555); MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, RGB555, DISPLAYIO_COLORSPACE_RGB555);
MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, RGB555_SWAPPED, DISPLAYIO_COLORSPACE_RGB555_SWAPPED); MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, RGB555_SWAPPED, DISPLAYIO_COLORSPACE_RGB555_SWAPPED);
MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, BGR565, DISPLAYIO_COLORSPACE_BGR565);
MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, BGR565_SWAPPED, DISPLAYIO_COLORSPACE_BGR565_SWAPPED);
MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, BGR555, DISPLAYIO_COLORSPACE_BGR555);
MAKE_ENUM_VALUE(displayio_colorspace_type, displayio_colorspace, BGR555_SWAPPED, DISPLAYIO_COLORSPACE_BGR555_SWAPPED);
//| class Colorspace: //| class Colorspace:
//| """The colorspace for a `ColorConverter` to operate in""" //| """The colorspace for a `ColorConverter` to operate in"""
@ -95,6 +99,10 @@ MAKE_ENUM_MAP(displayio_colorspace) {
MAKE_ENUM_MAP_ENTRY(displayio_colorspace, RGB565_SWAPPED), MAKE_ENUM_MAP_ENTRY(displayio_colorspace, RGB565_SWAPPED),
MAKE_ENUM_MAP_ENTRY(displayio_colorspace, RGB555), MAKE_ENUM_MAP_ENTRY(displayio_colorspace, RGB555),
MAKE_ENUM_MAP_ENTRY(displayio_colorspace, RGB555_SWAPPED), MAKE_ENUM_MAP_ENTRY(displayio_colorspace, RGB555_SWAPPED),
MAKE_ENUM_MAP_ENTRY(displayio_colorspace, BGR565),
MAKE_ENUM_MAP_ENTRY(displayio_colorspace, BGR565_SWAPPED),
MAKE_ENUM_MAP_ENTRY(displayio_colorspace, BGR555),
MAKE_ENUM_MAP_ENTRY(displayio_colorspace, BGR555_SWAPPED),
}; };
STATIC MP_DEFINE_CONST_DICT(displayio_colorspace_locals_dict, displayio_colorspace_locals_table); STATIC MP_DEFINE_CONST_DICT(displayio_colorspace_locals_dict, displayio_colorspace_locals_table);

View File

@ -46,6 +46,10 @@ typedef enum {
DISPLAYIO_COLORSPACE_RGB555, DISPLAYIO_COLORSPACE_RGB555,
DISPLAYIO_COLORSPACE_RGB565_SWAPPED, DISPLAYIO_COLORSPACE_RGB565_SWAPPED,
DISPLAYIO_COLORSPACE_RGB555_SWAPPED, DISPLAYIO_COLORSPACE_RGB555_SWAPPED,
DISPLAYIO_COLORSPACE_BGR565,
DISPLAYIO_COLORSPACE_BGR555,
DISPLAYIO_COLORSPACE_BGR565_SWAPPED,
DISPLAYIO_COLORSPACE_BGR555_SWAPPED,
} displayio_colorspace_t; } displayio_colorspace_t;
typedef bool (*display_bus_bus_reset)(mp_obj_t bus); typedef bool (*display_bus_bus_reset)(mp_obj_t bus);

View File

@ -176,6 +176,28 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d
} }
break; break;
case DISPLAYIO_COLORSPACE_BGR565_SWAPPED:
pixel = __builtin_bswap16(pixel);
MP_FALLTHROUGH;
case DISPLAYIO_COLORSPACE_BGR565: {
uint32_t b8 = (pixel >> 11) << 3;
uint32_t g8 = ((pixel >> 5) << 2) & 0xff;
uint32_t r8 = (pixel << 3) & 0xff;
pixel = (r8 << 16) | (g8 << 8) | b8;
}
break;
case DISPLAYIO_COLORSPACE_BGR555_SWAPPED:
pixel = __builtin_bswap16(pixel);
MP_FALLTHROUGH;
case DISPLAYIO_COLORSPACE_BGR555: {
uint32_t b8 = (pixel >> 10) << 3;
uint32_t g8 = ((pixel >> 5) << 3) & 0xff;
uint32_t r8 = (pixel << 3) & 0xff;
pixel = (r8 << 16) | (g8 << 8) | b8;
}
break;
case DISPLAYIO_COLORSPACE_RGB888: case DISPLAYIO_COLORSPACE_RGB888:
break; break;
} }