Struct png::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>,

§

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.