Skip to main content

RasterMut

Trait RasterMut 

Source
pub trait RasterMut<Pixel>: Raster<Pixel> {
    // Required method
    fn put(into: ImageMut<'_, &mut Self>, at: Coord, val: Pixel);

    // Provided method
    fn shade(
        image: ImageMut<'_, &mut Self>,
        f: impl FnMut(u32, u32, &mut Pixel),
    ) { ... }
}
Expand description

A raster layout where one can change pixel values independently.

In other words, requires that texels are actually one-by-one blocks of pixels.

Note that it does not prescribe any particular order of arrangement of these texels. Indeed, they could be in column major format, in row major format, ordered according to some space filling curve, etc. but subsampled images are not easily possible as pixels can not be written to independently.

Required Methods§

Source

fn put(into: ImageMut<'_, &mut Self>, at: Coord, val: Pixel)

Provided Methods§

Source

fn shade(image: ImageMut<'_, &mut Self>, f: impl FnMut(u32, u32, &mut Pixel))

Evaluate a function on each texel of the raster image.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<P> RasterMut<P> for Matrix<P>