fovea-display
fovea-display turns typed fovea images into display-ready pixels without hiding the decision of how values should be mapped to a screen.
That matters because a Mono16 inspection frame, a linear RgbF32 render target, and an already encoded Srgb8 image need different display policies. This crate makes that policy explicit with display strategies.
Install
Core display conversion has no windowing dependency:
[]
= "0.1.1"
= "0.1.1"
Enable local debug windows only when you want interactive inspection during development:
[]
= { = "0.1.1", = ["debug-window"] }
Features
| Feature | APIs | Intended use |
|---|---|---|
| (default) | DisplayStrategy, Identity, LinearToDisplay, AutoContrast, FixedRange, TextureSource |
Convert typed images for a renderer or GUI without depending on a windowing stack. |
debug-window |
show, DebugDisplay, histogram debug windows |
Quick local inspection of images and histograms while developing. |
Pick a display strategy
Every display operation names how image data becomes Srgba8 screen pixels.
| Strategy | Use when |
|---|---|
Identity |
Pixels are already display-encoded sRGB. |
LinearToDisplay |
Pixels are linear-light and need sRGB gamma encoding. |
AutoContrast |
You are debugging high-bit-depth or float data and want to see its current range. |
FixedRange |
You know the numeric range that should map to black/white. |
use ;
use ;
let px = new;
let display = Identity.to_display;
assert_eq!;
Preview an image during development
use Image;
use Srgb8;
use ;
let img = fill;
show;
For linear or high-bit-depth data, do not use Identity. Choose the strategy that describes the display mapping:
use Image;
use Mono16;
use ;
let img = generate;
let strategy = scan;
show;
GPU and renderer integration
TextureSource is for renderer boundaries. It requires the stronger PlainImage/contiguous-byte-access path because GPU upload needs a stable memory layout, not just random pixel access.
Use DisplayStrategy when you need to decide what values should be shown. Use TextureSource when you need to hand bytes and texture metadata to a renderer.
When NOT to use fovea-display
- You need a full GUI toolkit: use
egui,iced,winit, or your application framework. - You need video playback: use a media pipeline.
- You need color-management policy for a production display system: integrate fovea's typed pixels with your chosen color-management stack.
Crate ecosystem
| Crate | Purpose |
|---|---|
fovea |
Core typed image model. |
fovea-io |
PNG/JPEG/BMP file boundaries. |
fovea-display |
Display mappings, texture metadata, and debug windows. |
fovea-examples |
Repo-only examples showing these crates together. |
License
Licensed under the MIT License.