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§
Sourceconst MAX_BRIGHTNESS: u32
const MAX_BRIGHTNESS: u32
The maximum possible brightness for a pixel.
Required Methods§
Sourcefn dimensions(&self) -> (u32, u32)
fn dimensions(&self) -> (u32, u32)
Returns the dimensions of the image.
Sourcefn brightness(&self, x: u32, y: u32) -> u32
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 Twhere
T: GenericImageView<Pixel = P>,
P: PixelExt,
Available on crate feature image only.
impl<T, P> Image for Twhere
T: GenericImageView<Pixel = P>,
P: PixelExt,
Available on crate feature
image only.