def _refresh_area(self, area) -> bool:
"""Loop through dirty areas and redraw that area."""
# pylint: disable=too-many-locals
- buffer_size = 128
clipped = Area()
# Clip the area to the display by overlapping the areas.
pixels_per_word = 32 // self._core.colorspace.depth
pixels_per_buffer = clipped.size()
+ # We should have lots of memory
+ buffer_size = clipped.size() // pixels_per_word
+
subrectangles = 1
# for SH1107 and other boundary constrained controllers
# write one single row at a time
self._colors[palette_index].transparent = False
self._needs_refresh = True
+ """
def _get_palette(self):
- """Generate a palette for use with PIL"""
+ # Generate a palette for use with PIL
palette = []
for color in self._colors:
palette += color.rgba()[0:3]
return palette
def _get_alpha_palette(self):
- """Generate an alpha channel palette with white being
- opaque and black being transparent"""
+ # Generate an alpha channel palette with white being
+ # opaque and black being transparent
palette = []
for color in self._colors:
for _ in range(3):
palette += [0 if color.transparent else 0xFF]
return palette
+ """
def _get_color(
self,
# Reverse the shift by subtracting it from the leftmost shift
shift = (pixels_per_byte - 1) * colorspace.depth - shift
buffer[offset // pixels_per_byte] |= output_pixel.pixel << shift
+
return full_coverage
def _finish_refresh(self):