fovea
fovea is a high-precision, type-safe computer vision library for Rust, built around explicit pixel layout, colour-space correctness, and compile-time guarantees.
[]
= "0.1.1"
Quick start
Create an image, convert sRGB samples into linear-light values, and inspect the typed result:
use ;
use ;
use ;
let srgb = generate;
let linear: = convert_image;
assert_eq!;
assert_eq!;
assert!;
For a more tutorial-style first program, see examples/hello_image.rs in the crate repository.
Why fovea?
- Compile-time pixel correctness. Pixel types encode semantic meaning:
Srgb8andRgb8have similar storage but different colour-space guarantees, so algorithms can reject invalid inputs at compile time. - Explicit conversions. Lossy or semantic conversions are named through strategy types such as
SrgbGamma,Luminance, andClamp; data loss is never hidden in a default conversion. - Layout-aware image access.
PlainPixel,ImageView,RasterImage, andPlainImagemake byte layout, random access, row access, and contiguous storage separate capabilities with separate trait bounds.
Design principles
These numbered principles are the public digest for §N references in the fovea crate ecosystem:
- Types are the spec
- Concerns are orthogonal
- Traits layer progressively
- Conversions are named
- Layout is a contract
- Images are slices
- I/O is a boundary, not a pipeline
- Surface information, don't decide
- Channels and pixels are different roles
- Extension by addition
- Unsafe is local and proven
- Errors are layered
Crate ecosystem
| Crate | Purpose | Links |
|---|---|---|
fovea |
Core image types, pixels, analysis, and transforms | docs.rs |
fovea-io |
PNG, JPEG, and BMP codecs | GitHub · docs.rs |
fovea-display |
Display strategies and debug windows | GitHub · docs.rs |
fovea-derive |
Derive macros re-exported by fovea |
GitHub · docs.rs |
fovea-examples |
End-to-end example programs | GitHub |
License
Licensed under the MIT License.