Skip to main content

Raster

Trait Raster 

Source
pub trait Raster<Pixel>: Layout + Sized {
    // Required methods
    fn dimensions(&self) -> Coord;
    fn get(from: ImageRef<'_, &Self>, at: Coord) -> Option<Pixel>;
}
Expand description

A layout of individually addressable raster elements.

Often referred to as ‘pixels’, this is a special form of texels that represent a single group of color channels that form one color impression.

Note that it does not prescribe any particular order of arrangement of these channels. Indeed, they could be in column major format, in row major format, ordered according to some space filling curve, etc. Also, multiple pixels may form one group of subsampled channels.

Required Methods§

Source

fn dimensions(&self) -> Coord

Source

fn get(from: ImageRef<'_, &Self>, at: Coord) -> Option<Pixel>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P> Raster<P> for Matrix<P>

Note: on 64-bit targets only the first u32::MAX dimensions appear accessible.