trying to make lists

This commit is contained in:
foamyguy 2021-08-08 14:33:07 -05:00
parent 6d57f43eb3
commit 158048e56b
2 changed files with 24 additions and 3 deletions

View File

@ -336,9 +336,8 @@ STATIC mp_obj_t bitmaptools_obj_paint_fill(size_t n_args, const mp_obj_t *pos_ar
mp_raise_ValueError(translate("value out of range of target"));
}
uint32_t background_value, color_depth;
uint32_t background_value;
background_value = args[ARG_background_value].u_int;
color_depth = (1 << destination->bits_per_value);
if (color_depth <= background_value) {
mp_raise_ValueError(translate("background value out of range of target"));
}

View File

@ -256,7 +256,29 @@ void common_hal_bitmaptools_paint_fill(displayio_bitmap_t *destination,
int16_t x, int16_t y,
uint32_t value, uint32_t background_value) {
mp_printf(&mp_plat_print, "paint_fill");
/*def _boundaryFill4(self, px, py, fc, bc): # px & py = x, y coord to start fill, fc = fill color, bc = background color
fillArea = [[px, py]]
while len(fillArea) > 0:
x, y = fillArea.pop()
if self._bitmap[x, y] != bc:
continue
self._bitmap[x, y] = fc
fillArea.append((x + 1, y))
fillArea.append((x - 1, y))
fillArea.append((x, y + 1))
fillArea.append((x, y - 1))*/
mp_obj_list_t *fill_area;
//mp_obj_list_t *point;
//mp_obj_list_append(point, x);
//mp_obj_list_append(point, y);
mp_obj_list_append(MP_OBJ_FROM_PTR(*fill_area), MP_OBJ_NEW_QSTR(qstr_from_str("hello")));
//mp_printf(&mp_plat_print, fill_area[0]);
//mp_obj_print(mp_obj_list_pop(fill_area, 0), PRINT_STR);
}
void common_hal_bitmaptools_draw_line(displayio_bitmap_t *destination,