Enum png_pong::PngRaster

source ·
pub enum PngRaster {
    Gray8(Raster<SGray8>),
    Gray16(Raster<SGray16>),
    Rgb8(Raster<SRgb8>),
    Rgb16(Raster<SRgb16>),
    Palette(Raster<Gray8>, Box<Palette>, Vec<u8>),
    Graya8(Raster<SGraya8>),
    Graya16(Raster<SGraya16>),
    Rgba8(Raster<SRgba8>),
    Rgba16(Raster<SRgba16>),
}
Expand description

A Raster of one of the PNG types (all are sRGB gamma). PNGs with less than 8 bits per channel are scaled up to 8 bits per channel.

Variants§

§

Gray8(Raster<SGray8>)

1, 2, 4, 8-bit greyscale

§

Gray16(Raster<SGray16>)

16-bit grayscale

§

Rgb8(Raster<SRgb8>)

8-bit sRGB

§

Rgb16(Raster<SRgb16>)

16-bit sRGB

§

Palette(Raster<Gray8>, Box<Palette>, Vec<u8>)

1, 2, 4, 8-bit sRGB(A) palette

§

Graya8(Raster<SGraya8>)

8-bit grayscale with alpha

§

Graya16(Raster<SGraya16>)

16-bit grayscale with alpha

§

Rgba8(Raster<SRgba8>)

8-bit sRGB with alpha

§

Rgba16(Raster<SRgba16>)

16-bit sRGB with alpha

Trait Implementations§

source§

impl<P: Pixel> From<PngRaster> for Raster<P>
where P::Chan: From<Ch8> + From<Ch16>,

source§

fn from(raster: PngRaster) -> Raster<P>

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.