Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 8 additions & 5 deletions RGBMatrixEmulator/adapters/raw_adapter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from RGBMatrixEmulator.adapters.base import BaseAdapter

from PIL import Image

import numpy as np
from RGBMatrixEmulator.internal.pixel_style import PixelStyle


class RawAdapter(BaseAdapter):
SUPPORTED_PIXEL_STYLES = [
PixelStyle.SQUARE,
PixelStyle.CIRCLE,
PixelStyle.REAL,
]

MAX_FRAMES_STORED = 128
DEFAULT_MAX_FRAME = -1 # Never halts

Expand All @@ -29,7 +32,7 @@ def load_emulator_window(self):
pass

def _dump_screenshot(self, path):
image = Image.fromarray(np.array(self._last_frame(), dtype="uint8"), "RGB")
image = self._get_masked_image(self._last_frame())
image.save(path)

def _last_frame(self):
Expand Down
4 changes: 2 additions & 2 deletions test/test_config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_comment": "This config is used specifically to test RGBME via the raw adapter",
"pixel_outline": 0,
"pixel_size": 16,
"pixel_size": 1,
"pixel_style": "square",
"pixel_glow": 6,
"display_adapter": "raw",
Expand Down Expand Up @@ -31,4 +31,4 @@
"led_rgb_sequence": "RGB"
},
"log_level": "debug"
}
}
Loading