pub trait Image: Sized {
// Required methods
fn width(&self) -> u16;
fn height(&self) -> u16;
fn color_at(&self, x: u16, y: u16) -> Option<Color>;
unsafe fn color_at_unchecked(&self, x: u16, y: u16) -> Color;
fn to_raw_image(&self) -> RawImage;
}Required Methods§
Sourceunsafe fn color_at_unchecked(&self, x: u16, y: u16) -> Color
unsafe fn color_at_unchecked(&self, x: u16, y: u16) -> Color
Get the color at the given coordinates skipping bound checks
§Safety
The caller is responsible to ensure that 0 <= x < width and 0 <= y < height.
Sourcefn to_raw_image(&self) -> RawImage
fn to_raw_image(&self) -> RawImage
Convert this image trait object to a raw image
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.