pub enum IndexedWrapper {
Static(IndexedImage),
Animated(AnimatedIndexedImage),
}
Variants§
Static(IndexedImage)
Animated(AnimatedIndexedImage)
Implementations§
§impl IndexedWrapper
impl IndexedWrapper
pub fn set_palette(
&mut self,
palette: &[IciColor]
) -> Result<(), IndexedImageError>
pub fn set_palette( &mut self, palette: &[IciColor] ) -> Result<(), IndexedImageError>
Replace palette for image Will only return an error if the new palette has less colors than the image needs
pub fn set_palette_replace_id(
&mut self,
palette: &[IciColor],
id: u8
) -> Result<(), IndexedImageError>
pub fn set_palette_replace_id( &mut self, palette: &[IciColor], id: u8 ) -> Result<(), IndexedImageError>
Replace palette for image, any pixels outside the new palette will be replaced with id
Will only return an error if id is outside the new palette
pub fn set_palette_replace_color<C>(&mut self, palette: &[IciColor], color: C)
pub fn set_palette_replace_color<C>(&mut self, palette: &[IciColor], color: C)
Replace palette for image, any color indexes outside the palette will be expanded with color
pub fn size(&self) -> (u8, u8)
pub fn get_pixels(&self) -> &[u8] ⓘ
pub fn get_pixel_index(&self, x: u8, y: u8) -> Result<usize, IndexedImageError>
pub fn get_color(&self, idx: u8) -> Result<IciColor, IndexedImageError>
pub fn set_color( &mut self, idx: u8, color: IciColor ) -> Result<(), IndexedImageError>
pub fn get_palette(&self) -> &[IciColor]
pub fn min_palette_size_supported(&self) -> u8
pub fn width(&self) -> u8
pub fn height(&self) -> u8
pub fn update(&mut self, delta: f64)
pub fn reset(&mut self)
pub fn set_animate(&mut self, animate: bool)
pub fn animating(&self) -> bool
pub fn frame_count(&self) -> u8
pub fn is_animation(&self) -> bool
Trait Implementations§
§impl Clone for IndexedWrapper
impl Clone for IndexedWrapper
§fn clone(&self) -> IndexedWrapper
fn clone(&self) -> IndexedWrapper
Returns a copy 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 more§impl Debug for IndexedWrapper
impl Debug for IndexedWrapper
§impl From<AnimatedIndexedImage> for IndexedWrapper
impl From<AnimatedIndexedImage> for IndexedWrapper
§fn from(value: AnimatedIndexedImage) -> IndexedWrapper
fn from(value: AnimatedIndexedImage) -> IndexedWrapper
Converts to this type from the input type.
§impl From<IndexedImage> for IndexedWrapper
impl From<IndexedImage> for IndexedWrapper
§fn from(value: IndexedImage) -> IndexedWrapper
fn from(value: IndexedImage) -> IndexedWrapper
Converts to this type from the input type.
§impl PartialEq for IndexedWrapper
impl PartialEq for IndexedWrapper
§fn eq(&self, other: &IndexedWrapper) -> bool
fn eq(&self, other: &IndexedWrapper) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for IndexedWrapper
Auto Trait Implementations§
impl RefUnwindSafe for IndexedWrapper
impl Send for IndexedWrapper
impl Sync for IndexedWrapper
impl Unpin for IndexedWrapper
impl UnwindSafe for IndexedWrapper
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.