Enum lodepng::Image

source ·
pub enum Image {
    RawData(Bitmap<u8>),
    Grey(Bitmap<Grey<u8>>),
    Grey16(Bitmap<Grey<u16>>),
    GreyAlpha(Bitmap<GreyAlpha<u8>>),
    GreyAlpha16(Bitmap<GreyAlpha<u16>>),
    RGBA(Bitmap<RGBA>),
    RGB(Bitmap<RGB<u8>>),
    RGBA16(Bitmap<RGBA<u16>>),
    RGB16(Bitmap<RGB<u16>>),
}
Expand description

Bitmap types.

Images with >=8bpp are stored with pixel per vec element. Images with <8bpp are represented as a bunch of bytes, with multiple pixels per byte.

Check decoder.info_raw() for more info about the image type.

Variants§

§

RawData(Bitmap<u8>)

Bytes of the image. See bpp how many pixels per element there are

§

Grey(Bitmap<Grey<u8>>)

§

Grey16(Bitmap<Grey<u16>>)

§

GreyAlpha(Bitmap<GreyAlpha<u8>>)

§

GreyAlpha16(Bitmap<GreyAlpha<u16>>)

§

RGBA(Bitmap<RGBA>)

§

RGB(Bitmap<RGB<u8>>)

§

RGBA16(Bitmap<RGBA<u16>>)

§

RGB16(Bitmap<RGB<u16>>)

Implementations§

source§

impl Image

source

pub fn width(&self) -> usize

source

pub fn height(&self) -> usize

source

pub fn bytes(&self) -> &[u8]

Raw bytes of the underlying buffer

Trait Implementations§

source§

impl Debug for Image

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Image

§

impl Send for Image

§

impl Sync for Image

§

impl Unpin for Image

§

impl UnwindSafe for Image

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.