kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Invert y: this is now using standard definition
rodzic
d17cd858b5
commit
9477387df7
|
@ -88,7 +88,7 @@ picoscroll.set_pixels(image)
|
|||
### show_bitmap_1d
|
||||
|
||||
Show a view of a bitmap stored as the 7 least significant bits of
|
||||
bytes in a `bytearray`, bottom-up. Individual pixels are set to
|
||||
bytes in a `bytearray`, top-down. Individual pixels are set to
|
||||
`brightness` based on individual bit values, with the view defined by
|
||||
the offset and the width of the scroll (i.e. 17 columns). Changes will
|
||||
not be visible until `update()` is called.
|
||||
|
|
|
@ -115,7 +115,7 @@ mp_obj_t picoscroll_show_bitmap_1d(mp_obj_t bitmap_obj, mp_obj_t brightness_obj,
|
|||
unsigned char col = values[k];
|
||||
for (int y = 0; y < height; y++) {
|
||||
int val = brightness * ((col >> y) & 1);
|
||||
scroll->set_pixel(x, height - 1 - y, val);
|
||||
scroll->set_pixel(x, y, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue