png

Struct Info

Source
pub struct Info {
    pub width: u32,
    pub height: u32,
    pub bit_depth: BitDepth,
    pub color_type: ColorType,
    pub interlaced: bool,
    pub trns: Option<Vec<u8>>,
    pub pixel_dims: Option<PixelDimensions>,
    pub palette: Option<Vec<u8>>,
    pub frame_control: Option<FrameControl>,
    pub animation_control: Option<AnimationControl>,
    pub compression: Compression,
    pub filter: FilterType,
}
Expand description

PNG info struct

Fields§

§width: u32§height: u32§bit_depth: BitDepth§color_type: ColorType§interlaced: bool§trns: Option<Vec<u8>>§pixel_dims: Option<PixelDimensions>§palette: Option<Vec<u8>>§frame_control: Option<FrameControl>§animation_control: Option<AnimationControl>§compression: Compression§filter: FilterType

Implementations§

Source§

impl Info

Source

pub fn size(&self) -> (u32, u32)

Size of the image

Source

pub fn is_animated(&self) -> bool

Returns true if the image is an APNG image.

Source

pub fn animation_control(&self) -> Option<&AnimationControl>

Returns the frame control information of the image

Source

pub fn frame_control(&self) -> Option<&FrameControl>

Returns the frame control information of the current frame

Source

pub fn bits_per_pixel(&self) -> usize

Returns the bits per pixel

Source

pub fn bytes_per_pixel(&self) -> usize

Returns the bytes per pixel

Source

pub fn raw_bytes(&self) -> usize

Returns the number of bytes needed for one deinterlaced image

Source

pub fn raw_row_length(&self) -> usize

Returns the number of bytes needed for one deinterlaced row

Source

pub fn raw_row_length_from_width(&self, width: u32) -> usize

Returns the number of bytes needed for one deinterlaced row of width width

Trait Implementations§

Source§

impl Debug for Info

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Info

Source§

fn default() -> Info

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Info

§

impl RefUnwindSafe for Info

§

impl Send for Info

§

impl Sync for Info

§

impl Unpin for Info

§

impl UnwindSafe for Info

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.