Skip to content

extract pixel format strategies and data-driven driver registry - #6

Merged
anders94 merged 1 commit into
mainfrom
pixel-format
Aug 2, 2026
Merged

extract pixel format strategies and data-driven driver registry#6
anders94 merged 1 commit into
mainfrom
pixel-format

Conversation

@anders94

@anders94 anders94 commented Aug 2, 2026

Copy link
Copy Markdown
Owner
  • add formats.js: one strategy class per color mode (mono, 4gray, 3color, 7color) owning bit packing, clear values, transparency background and RGB quantization
  • EPDBase delegates setPixel/clear/rgbToColor/transparency to the active format, replacing ~180 lines of per-mode if/else chains; color buffer allocation driven by the format's usesColorBuffer flag
  • fold EPD7in3f's setPixel override (clamping) into SevenColorFormat
  • each driver exports meta + create; displays/index.js builds the factory lookup and getSupportedModels() from that registry, replacing the hand-maintained switch (getSupportedModels entries now include aliases)
  • pin format bit-packing and registry behavior with 6 new tests (29 total)
  • bump version to 0.4.0

Behavior is unchanged: all pixel/RGB logic was moved verbatim and the
byte-stream tests pass untouched.

  - add formats.js: one strategy class per color mode (mono, 4gray, 3color,
    7color) owning bit packing, clear values, transparency background and
    RGB quantization
  - EPDBase delegates setPixel/clear/rgbToColor/transparency to the active
    format, replacing ~180 lines of per-mode if/else chains; color buffer
    allocation driven by the format's usesColorBuffer flag
  - fold EPD7in3f's setPixel override (clamping) into SevenColorFormat
  - each driver exports meta + create; displays/index.js builds the factory
    lookup and getSupportedModels() from that registry, replacing the
    hand-maintained switch (getSupportedModels entries now include aliases)
  - pin format bit-packing and registry behavior with 6 new tests (29 total)
  - bump version to 0.4.0

  Behavior is unchanged: all pixel/RGB logic was moved verbatim and the
  byte-stream tests pass untouched.
@anders94
anders94 merged commit 41088b9 into main Aug 2, 2026
3 checks passed
@anders94
anders94 deleted the pixel-format branch August 2, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant