mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-01 22:08:55 -07:00
Merge branch 'dev' of https://github.com/DarkFlippers/unleashed-firmware into dev
This commit is contained in:
@@ -25,6 +25,9 @@ ICONS_TEMPLATE_C_FRAME = "const uint8_t {name}[] = {data};\n"
|
||||
ICONS_TEMPLATE_C_DATA = "const uint8_t* const {name}[] = {data};\n"
|
||||
ICONS_TEMPLATE_C_ICONS = "Icon {name} = {{.width={width},.height={height},.frame_count={frame_count},.frame_rate={frame_rate},.frames=_{name}}};\n"
|
||||
|
||||
MAX_IMAGE_WIDTH = 128
|
||||
MAX_IMAGE_HEIGHT = 64
|
||||
|
||||
|
||||
class Main(App):
|
||||
def init(self):
|
||||
@@ -112,6 +115,10 @@ class Main(App):
|
||||
|
||||
def _icon2header(self, file):
|
||||
image = file2image(file)
|
||||
if image.width > MAX_IMAGE_WIDTH or image.height > MAX_IMAGE_HEIGHT:
|
||||
raise Exception(
|
||||
f"Image {file} is too big ({image.width}x{image.height} vs. {MAX_IMAGE_WIDTH}x{MAX_IMAGE_HEIGHT})"
|
||||
)
|
||||
return image.width, image.height, image.data_as_carray()
|
||||
|
||||
def _iconIsSupported(self, filename):
|
||||
|
||||
Reference in New Issue
Block a user