Expand description
Types and traits for working with raw image data from machine vision cameras.
This crate aims to be a lowest common denominator for working with images from machine vision cameras from companies such as Basler, FLIR, and AVT.
- Can be compiled without standard library support (
no_std
). - Includes strongly-typed pixel formats in the pixel_format module (e.g. pixel_format::RGB8 and pixel_format::Mono8) to ensure correct API use.
- Includes types to efficiently iterate through images respecting strided layouts in the iter module.
- Includes structs which reference image data in the image_ref module.
- Includes struct which owns image data in the owned module.
Additionally several traits are defined to describe image data:
- ImageData defines the basics, such as image dimensions and the data buffer.
- ImageMutData is implemented for images with mutable data.
- Stride is implemented for images with strided data (i.e. each image row is encoded with exactly the same number of bytes, which may including padding).
- Compound traits combine these basic traits. ImageStride implements both
ImageData and Stride. ImageMutStride implements ImageMutData and
Stride. OwnedImage implements AsImageData, ImageData, and
Into<Vec<
u8
>>. OwnedImageStride implements AsImageStride, ImageStride, and Into<Vec<u8
>>. - Converter traits: AsImageData allows converting to
&dyn ImageData
, AsImageStride to&dyn ImageStride
, and AsImageMutStride to&dyn ImageMutStride
.
This crate is used extensively in Strand Camera.
Re-exports§
pub use pixel_format::PixFmt;
pub use pixel_format::PixelFormat;
Modules§
- cow
- Copy-on-Write (CoW) image that can either borrow or own its pixel data.
- image_
ref - References to image data
- iter
- Types to facilitate iterating over images
- owned
- Implementation of an image type which owns its own image buffer
- pixel_
format - Implementations of specific pixel formats
Structs§
- Image
Buffer - A concrete type which containing image data with pixel format
F
. - Image
Buffer MutRef - A concrete type with view of mutable image data with pixel format
F
. - Image
Buffer Ref - A concrete type with view of image data with pixel format
F
.
Traits§
- AsImage
Data - Can be converted into
ImageData
. - AsImage
MutStride - Can be converted into
ImageMutStride
. - AsImage
Stride - Can be converted into
ImageStride
. - Image
Data - An image.
- Image
MutData - A mutable image.
- Image
MutStride - A mutable image with a stride.
- Image
Stride - An image with a stride.
- Owned
Image - An image which can be moved into
Vec<u8>
. - Owned
Image Stride - An image with a stride which can be moved into
Vec<u8>
. - Stride
- An image whose data is stored such that successive rows are a stride apart.