Struct Info
#[non_exhaustive]
pub struct Info<'a> { pub width: u32, pub height: u32, pub bit_depth: BitDepth, pub color_type: ColorType, pub interlaced: bool, pub sbit: Option<Cow<'a, [u8]>>, pub trns: Option<Cow<'a, [u8]>>, pub pixel_dims: Option<PixelDimensions>, pub palette: Option<Cow<'a, [u8]>>, pub gama_chunk: Option<ScaledFloat>, pub chrm_chunk: Option<SourceChromaticities>, pub bkgd: Option<Cow<'a, [u8]>>, pub frame_control: Option<FrameControl>, pub animation_control: Option<AnimationControl>, pub source_gamma: Option<ScaledFloat>, pub source_chromaticities: Option<SourceChromaticities>, pub srgb: Option<SrgbRenderingIntent>, pub icc_profile: Option<Cow<'a, [u8]>>, pub coding_independent_code_points: Option<CodingIndependentCodePoints>, pub mastering_display_color_volume: Option<MasteringDisplayColorVolume>, pub content_light_level: Option<ContentLightLevelInfo>, pub exif_metadata: Option<Cow<'a, [u8]>>, pub uncompressed_latin1_text: Vec<TEXtChunk>, pub compressed_latin1_text: Vec<ZTXtChunk>, pub utf8_text: Vec<ITXtChunk> }
PNG info struct
Fields
width: u32height: u32bit_depth: BitDepthcolor_type: ColorTypeHow colors are stored in the image.
interlaced: boolsbit: Option<Cow<'a, [u8]>>The image's
sBITchunk, if present; contains significant bits of the sample.trns: Option<Cow<'a, [u8]>>The image's
tRNSchunk, if present; contains the alpha channel of the image's palette, 1 byte per entry.pixel_dims: Option<PixelDimensions>palette: Option<Cow<'a, [u8]>>The image's
PLTEchunk, if present; contains the RGB channels (in that order) of the image's palettes, 3 bytes per entry (1 per channel).gama_chunk: Option<ScaledFloat>The contents of the image's gAMA chunk, if present. Prefer
source_gammato also get the derived replacement gamma from sRGB chunks.chrm_chunk: Option<SourceChromaticities>The contents of the image's
cHRMchunk, if present. Prefersource_chromaticitiesto also get the derived replacements from sRGB chunks.bkgd: Option<Cow<'a, [u8]>>The contents of the image's
bKGDchunk, if present.frame_control: Option<FrameControl>animation_control: Option<AnimationControl>source_gamma: Option<ScaledFloat>Gamma of the source system. Set by both
gAMAas well as to a replacement bysRGBchunk.source_chromaticities: Option<SourceChromaticities>Chromaticities of the source system. Set by both
cHRMas well as to a replacement bysRGBchunk.srgb: Option<SrgbRenderingIntent>The rendering intent of an SRGB image.
Presence of this value also indicates that the image conforms to the SRGB color space.
icc_profile: Option<Cow<'a, [u8]>>The ICC profile for the image.
coding_independent_code_points: Option<CodingIndependentCodePoints>The coding-independent code points for video signal type identification of the image.
mastering_display_color_volume: Option<MasteringDisplayColorVolume>The mastering display color volume for the image.
content_light_level: Option<ContentLightLevelInfo>The content light information for the image.
exif_metadata: Option<Cow<'a, [u8]>>The EXIF metadata for the image.
uncompressed_latin1_text: Vec<TEXtChunk>tEXt field
compressed_latin1_text: Vec<ZTXtChunk>zTXt field
utf8_text: Vec<ITXtChunk>iTXt field
Implementations
impl Info<'_>
fn with_size(width: u32, height: u32) -> SelfA utility constructor for a default info with width and height.
fn size(&self) -> (u32, u32)Size of the image, width then height.
fn is_animated(&self) -> boolReturns true if the image is an APNG image.
fn animation_control(&self) -> Option<&AnimationControl>Returns the frame control information of the image.
fn frame_control(&self) -> Option<&FrameControl>Returns the frame control information of the current frame
fn bits_per_pixel(&self) -> usizeReturns the number of bits per pixel.
fn bytes_per_pixel(&self) -> usizeReturns the number of bytes per pixel.
fn raw_bytes(&self) -> usizeReturns the number of bytes needed for one deinterlaced image.
fn raw_row_length(&self) -> usizeReturns the number of bytes needed for one deinterlaced row.
fn raw_row_length_from_width(&self, width: u32) -> usizeReturns the number of bytes needed for one deinterlaced row of width
width.fn gamma(&self) -> Option<ScaledFloat>Gamma dependent on sRGB chunk
fn chromaticities(&self) -> Option<SourceChromaticities>Chromaticities dependent on sRGB chunk
Trait Implementations
impl Default for Info<'_>
fn default() -> Info<'static>
impl<'a> Clone for Info<'a>
fn clone(&self) -> Self
impl<'a> Debug for Info<'a>
fn fmt(&self, f: &mut Formatter<'_>) -> Result