Enum bevy_retrograde::core::image::ExtendedColorType [−]
pub enum ExtendedColorType {}Show variants
A8, L1, La1, Rgb1, Rgba1, L2, La2, Rgb2, Rgba2, L4, La4, Rgb4, Rgba4, L8, La8, Rgb8, Rgba8, L16, La16, Rgb16, Rgba16, Bgr8, Bgra8, Unknown(u8), // some variants omitted
Expand description
An enumeration of color types encountered in image formats.
This is not exhaustive over all existing image formats but should be granular enough to allow round tripping of decoding and encoding as much as possible. The variants will be extended as necessary to enable this.
Another purpose is to advise users of a rough estimate of the accuracy and effort of the decoding from and encoding to such an image format.
Variants
Pixel is 8-bit alpha
Pixel is 1-bit luminance
Pixel is 1-bit luminance with an alpha channel
Pixel contains 1-bit R, G and B channels
Pixel is 1-bit RGB with an alpha channel
Pixel is 2-bit luminance
Pixel is 2-bit luminance with an alpha channel
Pixel contains 2-bit R, G and B channels
Pixel is 2-bit RGB with an alpha channel
Pixel is 4-bit luminance
Pixel is 4-bit luminance with an alpha channel
Pixel contains 4-bit R, G and B channels
Pixel is 4-bit RGB with an alpha channel
Pixel is 8-bit luminance
Pixel is 8-bit luminance with an alpha channel
Pixel contains 8-bit R, G and B channels
Pixel is 8-bit RGB with an alpha channel
Pixel is 16-bit luminance
Pixel is 16-bit luminance with an alpha channel
Pixel contains 16-bit R, G and B channels
Pixel is 16-bit RGB with an alpha channel
Pixel contains 8-bit B, G and R channels
Pixel is 8-bit BGR with an alpha channel
Unknown(u8)
Pixel is of unknown color type with the specified bits per pixel. This can apply to pixels which are associated with an external palette. In that case, the pixel value is an index into the palette.
Implementations
impl ExtendedColorType
impl ExtendedColorType
pub fn channel_count(self) -> u8
pub fn channel_count(self) -> u8
Get the number of channels for colors of this type.
Note that the Unknown
variant returns a value of 1
since pixels can only be treated as
an opaque datum by the library.
Trait Implementations
impl Clone for ExtendedColorType
impl Clone for ExtendedColorType
pub fn clone(&self) -> ExtendedColorType
pub fn clone(&self) -> ExtendedColorType
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl Debug for ExtendedColorType
impl Debug for ExtendedColorType
impl From<ColorType> for ExtendedColorType
impl From<ColorType> for ExtendedColorType
pub fn from(c: ColorType) -> ExtendedColorType
pub fn from(c: ColorType) -> ExtendedColorType
Performs the conversion.
impl Hash for ExtendedColorType
impl Hash for ExtendedColorType
impl PartialEq<ExtendedColorType> for ExtendedColorType
impl PartialEq<ExtendedColorType> for ExtendedColorType
pub fn eq(&self, other: &ExtendedColorType) -> bool
pub fn eq(&self, other: &ExtendedColorType) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &ExtendedColorType) -> bool
pub fn ne(&self, other: &ExtendedColorType) -> bool
This method tests for !=
.
impl Copy for ExtendedColorType
impl Eq for ExtendedColorType
impl StructuralEq for ExtendedColorType
impl StructuralPartialEq for ExtendedColorType
Auto Trait Implementations
impl RefUnwindSafe for ExtendedColorType
impl Send for ExtendedColorType
impl Sync for ExtendedColorType
impl Unpin for ExtendedColorType
impl UnwindSafe for ExtendedColorType
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: 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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub 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. Read more
impl<T> DynHash for T where
T: DynEq + Hash,
impl<T> DynHash for T where
T: DynEq + Hash,
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
pub fn vzip(self) -> V