]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blobdiff - displayio/_structs.py
add missing return value in _begin_transaction
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / _structs.py
index 955b9b4a1a8c803ba66d890bed013b4500379a84..4c41c0054ed902cc85e4c88ac6a1bc7dbb78955b 100644 (file)
@@ -23,16 +23,6 @@ __version__ = "0.0.0+auto.0"
 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_Displayio.git"
 
 
 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_Displayio.git"
 
 
-@dataclass
-class RectangleStruct:
-    # pylint: disable=invalid-name
-    """Rectangle Struct Dataclass. To eventually be replaced by Area."""
-    x1: int
-    y1: int
-    x2: int
-    y2: int
-
-
 @dataclass
 class TransformStruct:
     # pylint: disable=invalid-name
 @dataclass
 class TransformStruct:
     # pylint: disable=invalid-name
@@ -42,14 +32,16 @@ class TransformStruct:
     dx: int = 1
     dy: int = 1
     scale: int = 1
     dx: int = 1
     dy: int = 1
     scale: int = 1
-    transpose_xy: bool = False
+    width: int = 0
+    height: int = 0
     mirror_x: bool = False
     mirror_y: bool = False
     mirror_x: bool = False
     mirror_y: bool = False
+    transpose_xy: bool = False
 
 
 @dataclass
 class ColorspaceStruct:
 
 
 @dataclass
 class ColorspaceStruct:
-    # pylint: disable=invalid-name
+    # pylint: disable=invalid-name, too-many-instance-attributes
     """Colorspace Struct Dataclass"""
     depth: int
     bytes_per_cell: int = 0
     """Colorspace Struct Dataclass"""
     depth: int
     bytes_per_cell: int = 0
@@ -58,7 +50,43 @@ class ColorspaceStruct:
     grayscale_bit: int = 0
     grayscale: bool = False
     tricolor: bool = False
     grayscale_bit: int = 0
     grayscale: bool = False
     tricolor: bool = False
+    sevencolor: bool = False  # Acep e-ink screens.
     pixels_in_byte_share_row: bool = False
     reverse_pixels_in_byte: bool = False
     reverse_bytes_in_word: bool = False
     dither: bool = False
     pixels_in_byte_share_row: bool = False
     reverse_pixels_in_byte: bool = False
     reverse_bytes_in_word: bool = False
     dither: bool = False
+
+
+@dataclass
+class InputPixelStruct:
+    """InputPixel Struct Dataclass"""
+
+    pixel: int = 0
+    x: int = 0
+    y: int = 0
+    tile: int = 0
+    tile_x: int = 0
+    tile_y: int = 0
+
+
+@dataclass
+class OutputPixelStruct:
+    """OutputPixel Struct Dataclass"""
+
+    pixel: int = 0
+    opaque: bool = False
+
+
+@dataclass
+class ColorStruct:
+    """Color Struct Dataclass"""
+
+    rgb888: int = 0
+    cached_colorspace: ColorspaceStruct = None
+    cached_color: int = 0
+    cached_colorspace_grayscale_bit: int = 0
+    cached_colorspace_grayscale: bool = False
+    transparent: bool = False
+
+
+null_transform = TransformStruct()  # Use defaults