Skip to content

Support RGB888 raw images and validate raw file size#25

Open
Inter-Raptor wants to merge 1 commit into
mainfrom
codex/verifier-l-affichage-des-images-boot.raw-et-home.bg.raw
Open

Support RGB888 raw images and validate raw file size#25
Inter-Raptor wants to merge 1 commit into
mainfrom
codex/verifier-l-affichage-des-images-boot.raw-et-home.bg.raw

Conversation

@Inter-Raptor
Copy link
Copy Markdown
Owner

Motivation

  • Some large .raw assets (e.g. boot/home backgrounds) were displayed garbled because displayDrawRAW assumed 2 bytes/pixel RGB565 format and did not validate file contents against expected size.
  • The goal is to fail early on format/dimension mismatches and support RGB888 raw images so correctly-exported assets render properly.

Description

  • Added file-size validation in displayDrawRAW to detect whether the file matches the expected RGB565 (2 bytes/pixel) or RGB888 (3 bytes/pixel) bytecount for the given width/height.
  • Implemented conditional per-pixel reads for both RGB565 and RGB888, converting RGB888 pixels to 16-bit with lcd.color565(r,g,b), and adjusted row skipping to use the bytes-per-pixel value.
  • Improved serial diagnostics to log unexpected sizes and the detected input format, and preserved existing memory/error handling and clipping behavior.

Testing

  • Searched the codebase for raw image usage with rg to confirm all callers of displayDrawRAW (launcher_ui.cpp) and inspected the modified function with nl/sed to verify the changes.
  • Reviewed the resulting diff to ensure the new logic replaces the old per-pixel read and updates row skipping and log messages.
  • No hardware build or on-device runtime display test was executed in this environment, so runtime verification on a device is still required to confirm correct rendering of boot.raw / home.bg.raw assets.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant