Skip to main content

AnyBitmap

Enum AnyBitmap 

Source
pub enum AnyBitmap {
    Rgb8(Bitmap<Rgb8>),
    Rgba8(Bitmap<Rgba8>),
    Gray8(Bitmap<Gray8>),
    Cmyk8(Bitmap<Cmyk8>),
    DeviceN8(Bitmap<DeviceN8>),
}
Expand description

A mode-erased bitmap, used when the transparency group stack must store bitmaps of varying pixel types without monomorphizing the entire stack.

Phase 2 will add rendering methods; Phase 1 only needs storage + dimensions.

Variants§

§

Rgb8(Bitmap<Rgb8>)

24-bit RGB, 8 bits per channel.

§

Rgba8(Bitmap<Rgba8>)

32-bit RGBA, 8 bits per channel (alpha stored in a separate plane).

§

Gray8(Bitmap<Gray8>)

8-bit grayscale.

§

Cmyk8(Bitmap<Cmyk8>)

32-bit CMYK, 8 bits per channel.

§

DeviceN8(Bitmap<DeviceN8>)

Up to 8 spot/device-N channels, 8 bits each.

Implementations§

Source§

impl AnyBitmap

Source

pub const fn width(&self) -> u32

Width of the contained bitmap in pixels.

Source

pub const fn height(&self) -> u32

Height of the contained bitmap in pixels.

Source

pub const fn mode(&self) -> PixelMode

The pixel mode (colour space + bit depth) of the contained bitmap.

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>,

Source§

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>,

Source§

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.