pub trait Image {
// Required method
unsafe fn as_bytes(&self) -> &[u8];
// Provided methods
fn sub(&self, p: Point, s: Size) -> SubImage<'_> { ... }
fn transparency(&self) -> Color { ... }
fn pixels(&self) -> usize { ... }
fn width(&self) -> u16 { ... }
fn height(&self) -> u16 { ... }
fn size(&self) -> Size { ... }
}Expand description
A loaded image file.
Required Methods§
Provided Methods§
Sourcefn transparency(&self) -> Color
fn transparency(&self) -> Color
The color used for transparency. If no transparency, returns Color::None.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".