Trait dui::image::ImageElement
[−]
[src]
pub trait ImageElement: Element { type Pixel: 'static + Copy; fn new<U>(width: u32, height: u32, pixels: U) -> Self
where
U: AsRef<[Self::Pixel]>; fn with<'a>(pixels: InPixels<'a, Self::Pixel>) -> Self { ... } }
Associated Types
Required Methods
fn new<U>(width: u32, height: u32, pixels: U) -> Self where
U: AsRef<[Self::Pixel]>,
U: AsRef<[Self::Pixel]>,
Creates a new image element with the specified dimensions from the specified pixel array.
Panics
Should panic if width
xheight
does not match the length of pixels
.
Provided Methods
fn with<'a>(pixels: InPixels<'a, Self::Pixel>) -> Self
Creates a new image element from the output of the pixels!
macro.
Panics
Panics if not all the rows of pixels
have the same length.