Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions displayio/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from PIL import Image
import numpy
from recordclass import recordclass
from displayio.colorconverter import ColorConverter

__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
Expand All @@ -53,8 +54,9 @@
BACKLIGHT_PWM = 2

# pylint: disable=unnecessary-pass, unused-argument

# pylint: disable=too-many-instance-attributes


class Display:
"""This initializes a display and connects it into CircuitPython. Unlike other objects
in CircuitPython, Display objects live until ``displayio.release_displays()`` is called.
Expand Down Expand Up @@ -152,6 +154,7 @@ def __init__(
self._refresh_thread = None
if self._auto_refresh:
self.auto_refresh = True
self._colorconverter = ColorConverter()

self._backlight_type = None
if backlight_pin is not None:
Expand Down Expand Up @@ -332,7 +335,11 @@ def _encode_pos(self, x, y):

def fill_row(self, y, buffer):
"""Extract the pixels from a single row"""
pass
for x in range(0, self._width):
_rgb_565 = self._colorconverter.convert(self._buffer.getpixel((x, y)))
buffer[x * 2] = (_rgb_565 >> 8) & 0xFF
buffer[x * 2 + 1] = _rgb_565 & 0xFF
return buffer

@property
def auto_refresh(self):
Expand Down