8000 Merge pull request #10113 from FoamyGuy/tile_palette_mapper · adafruit/circuitpython@6f9fd36 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f9fd36

Browse files
authored
Merge pull request #10113 from FoamyGuy/tile_palette_mapper
tile palette mapper module and class
2 parents 64e87e2 + f717ffc commit 6f9fd36

File tree

28 files changed

+382
-9
lines changed

28 files changed

+382
-9
lines changed

ports/atmel-samd/boards/circuitbrains_deluxe_m4/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ CIRCUITPY_PS2IO = 1
1414
CIRCUITPY_JPEGIO = 0
1515
CIRCUITPY_SPITARGET = 0
1616
CIRCUITPY_SYNTHIO = 0
17+
CIRCUITPY_TILEPALETTEMAPPER = 0

ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ LONGINT_IMPL = MPZ
1212
CIRCUITPY_SYNTHIO = 0
1313
CIRCUITPY_JPEGIO = 0
1414
CIRCUITPY_SPITARGET = 0
15+
CIRCUITPY_TILEPALETTEMAPPER = 0

ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ LONGINT_IMPL = MPZ
1313
CIRCUITPY_AESIO = 0
1414
CIRCUITPY_JPEGIO = 0
1515
CIRCUITPY_SYNTHIO = 0
16+
CIRCUITPY_TILEPALETTEMAPPER = 0

ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CIRCUITPY_CODEOP = 0
1414
CIRCUITPY_FLOPPYIO = 0
1515
CIRCUITPY_GIFIO = 0
1616
CIRCUITPY_JPEGIO = 0
17+
CIRCUITPY_TILEPALETTEMAPPER = 0
1718

1819
CIRCUITPY_BITBANG_APA102 = 1
1920

ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ CIRCUITPY_SYNTHIO = 0
1515
CIRCUITPY_JPEGIO = 0
1616
CIRCUITPY_FLOPPYIO = 0
1717
CIRCUITPY_TERMINALIO_VT100 = 0
18+
CIRCUITPY_TILEPALETTEMAPPER = 0

ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ CIRCUITPY_PULSEIO = 0
5454
CIRCUITPY_RGBMATRIX = 0
5555
CIRCUITPY_ROTARYIO = 0
5656
CIRCUITPY_RTC = 0
57+
CIRCUITPY_TILEPALETTEMAPPER = 0
5758
CIRCUITPY_ULAB = 0
5859
CIRCUITPY_USB_HID = 0
5960
CIRCUITPY_USB_MIDI = 0

ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ LONGINT_IMPL = MPZ
1313
CIRCUITPY_JPEGIO = 0
1414
CIRCUITPY_SPITARGET = 0
1515
CIRCUITPY_SYNTHIO = 0
16+
CIRCUITPY_TILEPALETTEMAPPER = 0

ports/atmel-samd/boards/uartlogger2/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ CIRCUITPY_SPITARGET = 0
1313
CIRCUITPY_SYNTHIO = 0
1414
CIRCUITPY_JPEGIO = 0
1515
CIRCUITPY_TERMINALIO_VT100 = 0
16+
CIRCUITPY_TILEPALETTEMAPPER = 0

ports/atmel-samd/mpconfigport.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ CIRCUITPY_ZLIB = 0
6060
# Turn off a few more things that don't fit in 192kB
6161

6262
CIRCUITPY_TERMINALIO_VT100 = 0
63+
CIRCUITPY_TILEPALETTEMAPPER = 0
6364

6465
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
6566
CIRCUITPY_ONEWIREIO ?= 0

ports/stm/boards/meowbit_v121/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ CIRCUITPY_BLEIO_HCI = 0
2929
CIRCUITPY_EPAPERDISPLAY = 0
3030
CIRCUITPY_KEYPAD_DEMUX = 0
3131
CIRCUITPY_SHARPDISPLAY = 0
32+
CIRCUITPY_TILEPALETTEMAPPER = 0
3233
CIRCUITPY_ULAB = 0
3334
CIRCUITPY_ZLIB = 0
3435

ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct = true
9090
supervisor = false
9191
synthio = false
9292
terminalio = false
93+
tilepalettemapper = false
9394
time = true
9495
touchio = false
9596
traceback = false

ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct = true
9090
supervisor = false
9191
synthio = false
9292
terminalio = false
93+
tilepalettemapper = false
9394
time = true
9495
touchio = false
9596
traceback = false

ports/zephyr-cp/boards/nordic/nrf7002dk/autogen_board_info.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct = true
9090
supervisor = false
9191
synthio = false
9292
terminalio = false
93+
tilepalettemapper = false
9394
time = true
9495
touchio = false
9596
traceback = false

ports/zephyr-cp/boards/renesas/ek_ra6m5/autogen_board_info.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct = true
9090
supervisor = false
9191
synthio = false
9292
terminalio = false
93+
tilepalettemapper = false
9394
time = true
9495
touchio = false
9596
traceback = false

ports/zephyr-cp/boards/renesas/ek_ra8d1/autogen_board_info.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct = true
9090
supervisor = false
9191
synthio = false
9292
terminalio = false
93+
tilepalettemapper = false
9394
time = true
9495
touchio = false
9596
traceback = false

ports/zephyr-cp/boards/st/nucleo_u575zi_q/autogen_board_info.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct = true
9090
supervisor = false
9191
synthio = false
9292
terminalio = false
93+
tilepalettemapper = false
9394
time = true
9495
touchio = false
9596
traceback = false

ports/zephyr-cp/boards/st/stm32h7b3i_dk/autogen_board_info.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct = true
9090
supervisor = false
9191
synthio = false
9292
terminalio = false
93+
tilepalettemapper = false
9394
time = true
9495
touchio = false
9596
traceback = false

py/circuitpy_defns.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ endif
396396
ifeq ($(CIRCUITPY_FONTIO),1)
397397
SRC_PATTERNS += fontio/%
398398
endif
399+
ifeq ($(CIRCUITPY_TILEPALETTEMAPPER),1)
400+
SRC_PATTERNS += tilepalettemapper/%
401+
endif
399402
ifeq ($(CIRCUITPY_TIME),1)
400403
SRC_PATTERNS += time/%
401404
endif
@@ -733,6 +736,8 @@ SRC_SHARED_MODULE_ALL = \
733736
synthio/__init__.c \
734737
terminalio/Terminal.c \
735738
terminalio/__init__.c \
739+
tilepalettemapper/__init__.c \
740+
tilepalettemapper/TilePaletteMapper.c \
736741
time/__init__.c \
737742
traceback/__init__.c \
738743
uheap/__init__.c \

py/circuitpy_mpconfig.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ CFLAGS += -DCIRCUITPY_TERMINALIO_VT100=$(CIRCUITPY_TERMINALIO_VT100)
558558
CIRCUITPY_FONTIO ?= $(call enable-if-all,$(CIRCUITPY_DISPLAYIO) $(CIRCUITPY_TERMINALIO))
559559
CFLAGS += -DCIRCUITPY_FONTIO=$(CIRCUITPY_FONTIO)
560560

561+
CIRCUITPY_TILEPALETTEMAPPER ?= $(CIRCUITPY_DISPLAYIO)
562+
CFLAGS += -DCIRCUITPY_TILEPALETTEMAPPER=$(CIRCUITPY_TILEPALETTEMAPPER)
563+
561564
CIRCUITPY_TIME ?= 1
562565
CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME)
563566

shared-bindings/displayio/TileGrid.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@
1717
#include "shared-bindings/displayio/ColorConverter.h"
1818
#include "shared-bindings/displayio/OnDiskBitmap.h"
1919
#include "shared-bindings/displayio/Palette.h"
20+
#ifdef CIRCUITPY_TILEPALETTEMAPPER
21+
#include "shared-bindings/tilepalettemapper/TilePaletteMapper.h"
22+
#endif
23+
24+
25+
void displayio_tilegrid_validate_pixel_shader(mp_obj_t pixel_shader) {
26+
bool valid_type = true;
27+
if (!mp_obj_is_type(pixel_shader, &displayio_palette_type) && !mp_obj_is_type(pixel_shader, &displayio_colorconverter_type)) {
28+
valid_type = false;
29+
}
30+
#if CIRCUITPY_TILEPALETTEMAPPER
31+
if (mp_obj_is_type(pixel_shader, &tilepalettemapper_tilepalettemapper_type)) {
32+
valid_type = true;
33+
}
34+
#endif
35+
if (!valid_type) {
36+
mp_raise_TypeError_varg(MP_ERROR_TEXT("unsupported %q type"), MP_QSTR_pixel_shader);
37+
}
38+
}
2039

2140
//| class TileGrid:
2241
//| """A grid of tiles sourced out of one bitmap
@@ -89,10 +108,7 @@ static mp_obj_t displayio_tilegrid_make_new(const mp_obj_type_t *type, size_t n_
89108
mp_raise_TypeError_varg(MP_ERROR_TEXT("unsupported %q type"), MP_QSTR_bitmap);
90109
}
91110
mp_obj_t pixel_shader = args[ARG_pixel_shader].u_obj;
92-
if (!mp_obj_is_type(pixel_shader, &displayio_colorconverter_type) &&
93-
!mp_obj_is_type(pixel_shader, &displayio_palette_type)) {
94-
mp_raise_TypeError_varg(MP_ERROR_TEXT("unsupported %q type"), MP_QSTR_pixel_shader);
95-
}
111+
displayio_tilegrid_validate_pixel_shader(pixel_shader);
96112
uint16_t tile_width = args[ARG_tile_width].u_int;
97113
if (tile_width == 0) {
98114
tile_width = bitmap_width;
@@ -323,10 +339,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_pixel_shader_obj, displayio_til
323339

324340
static mp_obj_t displayio_tilegrid_obj_set_pixel_shader(mp_obj_t self_in, mp_obj_t pixel_shader) {
325341
displayio_tilegrid_t *self = native_tilegrid(self_in);
326-
if (!mp_obj_is_type(pixel_shader, &displayio_palette_type) && !mp_obj_is_type(pixel_shader, &displayio_colorconverter_type)) {
327-
mp_raise_TypeError_varg(MP_ERROR_TEXT("unsupported %q type"), MP_QSTR_pixel_shader);
328-
}
329-
342+
displayio_tilegrid_validate_pixel_shader(pixel_shader);
330343
common_hal_displayio_tilegrid_set_pixel_shader(self, pixel_shader);
331344

332345
return mp_const_none;
Lines changed: 167 additions & 0 deletions
< F438 tr class="diff-line-row">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
#include <stdint.h>
7+
#include <stdlib.h>
8+
#include "shared/runtime/context_manager_helpers.h"
9+
#include "py/binary.h"
10+
#include "py/objproperty.h"
11+
#include "py/runtime.h"
12+
#include "shared-bindings/util.h"
13+
#include "shared-bindings/displayio/Palette.h"
14+
#include "shared-bindings/tilepalettemapper/TilePaletteMapper.h"
15+
16+
//| class TilePaletteMapper:
17+
//| """Remaps color indices from the source bitmap to alternate indices on a
18+
//| per-tile basis. This allows for altering coloring of tiles based on
19+
//| their tilegrid location. It also allows for using a limited color
20+
//| bitmap with a wider array of colors."""
21+
//|
22+
//| def __init__(
23+
//| self, palette: displayio.Palette, input_color_count: int, width: int, height: int
24+
//| ) -> None:
25+
//| """Create a TilePaletteMApper object to store a set of color mappings for tiles.
26+
//|
27+
//| :param displayio.Palette palette: The palette to get mapped colors from.
28+
//| :param int input_color_count: The number of colors in in the input bitmap.
29+
//| :param int width: The width of the grid in tiles.
30+
//| :par C2EE am int height: The height of the grid in tiles."""
31+
//|
32+
33+
static mp_obj_t tilepalettemapper_tilepalettemapper_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
34+
enum { ARG_palette, ARG_input_color_count, ARG_width, ARG_height };
35+
static const mp_arg_t allowed_args[] = {
36+
{ MP_QSTR_palette, MP_ARG_OBJ | MP_ARG_REQUIRED },
37+
{ MP_QSTR_input_color_count, MP_ARG_INT | MP_ARG_REQUIRED },
38+
{ MP_QSTR_width, MP_ARG_INT | MP_ARG_REQUIRED },
39+
{ MP_QSTR_height, MP_ARG_INT | MP_ARG_REQUIRED },
40+
};
41+
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
42+
mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
43+
mp_obj_t palette = args[ARG_palette].u_obj;
44+
if (!mp_obj_is_type(palette, &displayio_palette_type)) {
45+
mp_raise_TypeError_varg(MP_ERROR_TEXT("unsupported %q type"), MP_QSTR_pixel_shader);
46+
}
47+
tilepalettemapper_tilepalettemapper_t *self = mp_obj_malloc(tilepalettemapper_tilepalettemapper_t, &tilepalettemapper_tilepalettemapper_type);
48+
common_hal_tilepalettemapper_tilepalettemapper_construct(self, palette, args[ARG_input_color_count].u_int, args[ARG_width].u_int, args[ARG_height].u_int);
49+
50+
return MP_OBJ_FROM_PTR(self);
51+
}
52+
53+
//| width: int
54+
//| """Width of the tile palette mapper in tiles."""
55+
static mp_obj_t tilepalettemapper_tilepalettemapper_obj_get_width(mp_obj_t self_in) {
56+
tilepalettemapper_tilepalettemapper_t *self = MP_OBJ_TO_PTR(self_in);
57+
return MP_OBJ_NEW_SMALL_INT(common_hal_tilepalettemapper_tilepalettemapper_get_width(self));
58+
}
59+
MP_DEFINE_CONST_FUN_OBJ_1(tilepalettemapper_tilepalettemapper_get_width_obj, tilepalettemapper_tilepalettemapper_obj_get_width);
60+
61+
MP_PROPERTY_GETTER(tilepalettemapper_tilepalettemapper_width_obj,
62+
(mp_obj_t)&tilepalettemapper_tilepalettemapper_get_width_obj);
63+
64+
//| height: int
65+
//| """Height of the tile palette mapper in tiles."""
66+
static mp_obj_t tilepalettemapper_tilepalettemapper_obj_get_height(mp_obj_t self_in) {
67+
tilepalettemapper_tilepalettemapper_t *self = MP_OBJ_TO_PTR(self_in);
68+
return MP_OBJ_NEW_SMALL_INT(common_hal_tilepalettemapper_tilepalettemapper_get_height(self));
69+
}
70+
MP_DEFINE_CONST_FUN_OBJ_1(tilepalettemapper_tilepalettemapper_get_height_obj, tilepalettemapper_tilepalettemapper_obj_get_height);
71+
72+
MP_PROPERTY_GETTER(tilepalettemapper_tilepalettemapper_height_obj,
73+
(mp_obj_t)&tilepalettemapper_tilepalettemapper_get_height_obj);
74+
75+
76+
//| palette: displayio.Palette
77+
//| """The palette that the mapper uses."""
78+
//|
79+
static mp_obj_t tilepalettemapper_tilepalettemapper_obj_get_palette(mp_obj_t self_in) {
80+
tilepalettemapper_tilepalettemapper_t *self = MP_OBJ_TO_PTR(self_in);
81+
return common_hal_tilepalettemapper_tilepalettemapper_get_palette(self);
82+
}
83+
MP_DEFINE_CONST_FUN_OBJ_1(tilepalettemapper_tilepalettemapper_get_palette_obj, tilepalettemapper_tilepalettemapper_obj_get_palette);
84+
85+
MP_PROPERTY_GETTER(tilepalettemapper_tilepalettemapper_palette_obj,
86+
(mp_obj_t)&tilepalettemapper_tilepalettemapper_get_palette_obj);
87+
88+
89+
//| def __getitem__(self, index: Union[Tuple[int, int], int]) -> Tuple[int]:
90+
//| """Returns the mapping for the given index. The index can either be an x,y tuple or an int equal
91+
//| to ``y * width + x``.
92+
//|
93+
//| This allows you to::
94+
//|
95+
//| print(tpm[0])"""
96+
//| ...
97+
//|
98+
//| def __setitem__(self, index: Union[Tuple[int, int], int], value: List[int]) -> None:
99+
//| """Sets the mapping at the given tile index. The index can either be an x,y tuple or an int equal
100+
//| to ``y * width + x``.
101+
//|
102+
//| This allows you to::
103+
//|
104+
//| tpm[0] = [1,0]
105+
//|
106+
//| or::
107+
//|
108+
//| tpm[0,0] = [1,0]"""
109+
//| ...
110+
//|
111+
//|
112+
static mp_obj_t tilepalettemapper_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t value_obj) {
113+
tilepalettemapper_tilepalettemapper_t *self = MP_OBJ_TO_PTR(self_in);
114+
if (mp_obj_is_type(index_obj, &mp_type_slice)) {
115+
mp_raise_NotImplementedError(MP_ERROR_TEXT("Slices not supported"));
116+
} else {
117+
uint16_t x = 0;
118+
uint16_t y = 0;
119+
if (mp_obj_is_small_int(index_obj)) {
120+
mp_int_t i = MP_OBJ_SMALL_INT_VALUE(index_obj);
121+
uint16_t width = common_hal_tilepalettemapper_tilepalettemapper_get_width(self);
122+
x = i % width;
123+
y = i / width;
124+
} else {
125+
mp_obj_t *items;
126+
mp_obj_get_array_fixed_n(index_obj, 2, &items);
127+
x = mp_obj_get_int(items[0]);
128+
y = mp_obj_get_int(items[1]);
129+
}
130+
if (x >= common_hal_tilepalettemapper_tilepalettemapper_get_width(self) ||
131+
y >= common_hal_tilepalettemapper_tilepalettemapper_get_height(self)) {
132+
mp_raise_IndexError(MP_ERROR_TEXT("Tile index out of bounds"));
133+
}
134+
135+
if (value_obj == MP_OBJ_SENTINEL) {
136+
// load
137+
return common_hal_tilepalettemapper_tilepalettemapper_get_mapping(self, x, y);
138+
} else if (value_obj == mp_const_none) {
139+
return MP_OBJ_NULL; // op not supported
140+
} else {
141+
size_t len = 0;
142+
mp_obj_t *items;
143+
mp_obj_list_get(value_obj, &len, &items);
144+
mp_arg_validate_int_range(len, 0, self->input_color_count, MP_QSTR_mapping_length);
145+
common_hal_tilepalettemapper_tilepalettemapper_set_mapping(self, x, y, len, items);
146+
}
147+
}
148+
return mp_const_none;
149+
}
150+
151+
152+
static const mp_rom_map_elem_t tilepalettemapper_tilepalettemapper_locals_dict_table[] = {
153+
{ MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&tilepalettemapper_tilepalettemapper_width_obj) },
154+
{ MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&tilepalettemapper_tilepalettemapper_height_obj) },
155+
{ MP_ROM_QSTR(MP_QSTR_palette), MP_ROM_PTR(&tilepalettemapper_tilepalettemapper_palette_obj) },
156+
};
157+
static MP_DEFINE_CONST_DICT(tilepalettemapper_tilepalettemapper_locals_dict, tilepalettemapper_tilepalettemapper_locals_dict_table);
158+
159+
MP_DEFINE_CONST_OBJ_TYPE(
160+
tilepalettemapper_tilepalettemapper_type,
161+
MP_QSTR_TilePaletteMapper,
162+
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
163+
make_new, tilepalettemapper_tilepalettemapper_make_new,
164+
locals_dict, &tilepalettemapper_tilepalettemapper_locals_dict,
165+
subscr, tilepalettemapper_subscr,
166+
iter, mp_obj_generic_subscript_getiter
167+
);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
#include "shared-module/tilepalettemapper/TilePaletteMapper.h"
7+
8+
extern const mp_obj_type_t tilepalettemapper_tilepalettemapper_type;
9+
10+
void common_hal_tilepalettemapper_tilepalettemapper_construct(tilepalettemapper_tilepalettemapper_t *self,
11+
mp_obj_t paltte, uint16_t input_color_count, uint16_t bitmap_width_in_tiles, uint16_t bitmap_height_in_tiles);
12+
13+
14+
uint16_t common_hal_tilepalettemapper_tilepalettemapper_get_width(tilepalettemapper_tilepalettemapper_t *self);
15+
uint16_t common_hal_tilepalettemapper_tilepalettemapper_get_height(tilepalettemapper_tilepalettemapper_t *self);
16+
mp_obj_t common_hal_tilepalettemapper_tilepalettemapper_get_palette(tilepalettemapper_tilepalettemapper_t *self);
17+
mp_obj_t common_hal_tilepalettemapper_tilepalettemapper_get_mapping(tilepalettemapper_tilepalettemapper_t *self, uint16_t x, uint16_t y);
18+
void common_hal_tilepalettemapper_tilepalettemapper_set_mapping(tilepalettemapper_tilepalettemapper_t *self, uint16_t x, uint16_t y, size_t len, mp_obj_t *items);

0 commit comments

Comments
 (0)
0