Image

Trait Image 

Source
pub trait Image {
    const MAX_BRIGHTNESS: u32;

    // Required methods
    fn dimensions(&self) -> (u32, u32);
    fn brightness(&self, x: u32, y: u32) -> u32;
}
Expand description

Image data.

This trait can be implemented on image types in order to add support for hashing.

If the image feature is enabled (the default), this trait is automatically implemented for images from the image crate.

Required Associated Constants§

Source

const MAX_BRIGHTNESS: u32

The maximum possible brightness for a pixel.

Required Methods§

Source

fn dimensions(&self) -> (u32, u32)

Returns the dimensions of the image.

Source

fn brightness(&self, x: u32, y: u32) -> u32

Returns the brightness of the pixel at the given position in the image, in the range 0..=MAX_BRIGHTNESS.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, P> Image for T
where T: GenericImageView<Pixel = P>, P: PixelExt,

Available on crate feature image only.
Source§

const MAX_BRIGHTNESS: u32 = P::MAX_BRIGHTNESS