pub enum DynamicImage {
Zune(Image),
Image(DynamicImage),
}Expand description
Image type that uses either zune-image (fast) or image crate (fallback)
Variants§
Zune(Image)
Fast decoder (zune-image) - used for JPEG, PNG, BMP, etc.
Image(DynamicImage)
Fallback decoder (image crate) - used for WebP, GIF, TIFF, etc.
Implementations§
Source§impl DynamicImage
impl DynamicImage
pub fn from_path_as_zune(path: &Path) -> Result<Self, ProgramError>
pub fn from_path(path: &Path) -> Result<Self, ProgramError>
pub fn from_rgba8( width: u32, height: u32, data: Vec<u8>, ) -> Result<Self, ProgramError>
pub fn dimensions(&self) -> (u32, u32)
pub fn resize( &self, max_width: u32, max_height: u32, ) -> Result<Self, ProgramError>
pub fn as_rgb8(&self) -> Option<RgbImage>
pub fn as_rgba8(&self) -> Option<RgbaImage>
pub fn to_rgb8(&self) -> RgbImage
pub fn pixels(&self) -> PixelIterator ⓘ
Trait Implementations§
Source§impl Clone for DynamicImage
impl Clone for DynamicImage
Source§fn clone(&self) -> DynamicImage
fn clone(&self) -> DynamicImage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicImage
impl RefUnwindSafe for DynamicImage
impl Send for DynamicImage
impl Sync for DynamicImage
impl Unpin for DynamicImage
impl UnwindSafe for DynamicImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more