Skip to content

Commit 2513277

Browse files
authored
Merge pull request #10431 from FoamyGuy/picodvi_color_depth
expose picodvi.framebuffer.color_depth to python
2 parents c5128a9 + 41720da commit 2513277

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ports/raspberrypi/bindings/picodvi/Framebuffer.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,24 @@ MP_DEFINE_CONST_FUN_OBJ_1(picodvi_framebuffer_get_height_obj, picodvi_framebuffe
178178
MP_PROPERTY_GETTER(picodvi_framebuffer_height_obj,
179179
(mp_obj_t)&picodvi_framebuffer_get_height_obj);
180180

181+
//| color_depth: int
182+
//| """The color depth of the framebuffer."""
183+
static mp_obj_t picodvi_framebuffer_get_color_depth(mp_obj_t self_in) {
184+
picodvi_framebuffer_obj_t *self = (picodvi_framebuffer_obj_t *)self_in;
185+
check_for_deinit(self);
186+
return MP_OBJ_NEW_SMALL_INT(common_hal_picodvi_framebuffer_get_color_depth(self));
187+
}
188+
MP_DEFINE_CONST_FUN_OBJ_1(picodvi_framebuffer_get_color_depth_obj, picodvi_framebuffer_get_color_depth);
189+
MP_PROPERTY_GETTER(picodvi_framebuffer_color_depth_obj,
190+
(mp_obj_t)&picodvi_framebuffer_get_color_depth_obj);
191+
192+
181193
static const mp_rom_map_elem_t picodvi_framebuffer_locals_dict_table[] = {
182194
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&picodvi_framebuffer_deinit_obj) },
183195

184196
{ MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&picodvi_framebuffer_width_obj) },
185197
{ MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&picodvi_framebuffer_height_obj) },
198+
{ MP_ROM_QSTR(MP_QSTR_color_depth), MP_ROM_PTR(&picodvi_framebuffer_color_depth_obj) },
186199
};
187200
static MP_DEFINE_CONST_DICT(picodvi_framebuffer_locals_dict, picodvi_framebuffer_locals_dict_table);
188201

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy