-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Goal
PixelImage in ribir_painter should only store raw pixel data. Image format handling (PNG, JPEG) should be moved elsewhere.
This will make the painter crate more focused and reduce dependencies.
Current State
ribir_painter currently has optional image crate dependency with png and jpeg features that provide:
PixelImage::from_png()/PixelImage::from_jpeg()PixelImage::write_as_png()/PixelImage::write_as_jpeg()PixelImage::parse_img()
Blockers
1. Font Raster Glyphs
File: painter/src/text/font_db.rs:371
glyph_raster_image() parses PNG glyph images embedded in fonts. Need to decide:
- Keep as internal implementation
- Move to core
- Drop support
2. Dev-Helper Tests
File: dev-helper/src/image_test.rs
Uses write_as_png() / from_png() for test image comparison. Solution TBD.
3. Examples
Files: examples/messages, examples/storybook, examples/pomodoro
Currently use PixelImage::from_png(include_bytes!(...)).
Solution: Migrate to use Image widget via asset! macro.
4. GPU/Core Tests
Files: gpu/src/gpu_backend.rs, core/src/builtin_widgets/backdrop_filter.rs
Load test PNG files using PixelImage::from_png().
Solution: Migrate to use Image widget or core utilities.
Migration Plan
- Migrate examples to use
Imagewithasset!macro - Address dev-helper test image handling (solution TBD)
- Decide on font raster glyph handling
- Remove
imagedependency andpng/jpegfeatures from painter