pub enum DynImage<T> {
Y(Image<T, 1>),
Ya(Image<T, 2>),
Rgb(Image<T, 3>),
Rgba(Image<T, 4>),
}Expand description
Dynamic image.
Can be any of {Y8, YA8, RGB8, RGB16}.
Variants§
Y(Image<T, 1>)
Y image
Ya(Image<T, 2>)
YA image
Rgb(Image<T, 3>)
RGB image
Rgba(Image<T, 4>)
RGBA image
Implementations§
Source§impl<T: AsMut<[u8]> + AsRef<[u8]>> DynImage<T>
impl<T: AsMut<[u8]> + AsRef<[u8]>> DynImage<T>
Source§impl<T> DynImage<T>
impl<T> DynImage<T>
Sourcepub fn get_y(self) -> Result<Image<T, 1>, Self>
pub fn get_y(self) -> Result<Image<T, 1>, Self>
Gets out the Y image, if its there, else returning self.
If you want to convert, see DynImage::to_y.
Sourcepub fn get_ya(self) -> Result<Image<T, 2>, Self>
pub fn get_ya(self) -> Result<Image<T, 2>, Self>
Gets out the YA image, if its there, else returning self.
If you want to convert, see DynImage::to_ya.
Sourcepub fn get_rgb(self) -> Result<Image<T, 3>, Self>
pub fn get_rgb(self) -> Result<Image<T, 3>, Self>
Gets out the RGB image, if its there, else returning self.
If you want to convert, see DynImage::to_rgb.
Sourcepub fn get_rgba(self) -> Result<Image<T, 4>, Self>
pub fn get_rgba(self) -> Result<Image<T, 4>, Self>
Gets out the RGBA image, if its there, else returning self.
If you want to convert, see DynImage::to_rgba.
Trait Implementations§
impl Copy for DynImage<&[u8]>
impl<T> StructuralPartialEq for DynImage<T>
Auto Trait Implementations§
impl<T> Freeze for DynImage<T>where
T: Freeze,
impl<T> RefUnwindSafe for DynImage<T>where
T: RefUnwindSafe,
impl<T> Send for DynImage<T>where
T: Send,
impl<T> Sync for DynImage<T>where
T: Sync,
impl<T> Unpin for DynImage<T>where
T: Unpin,
impl<T> UnwindSafe for DynImage<T>where
T: UnwindSafe,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.