#[non_exhaustive]pub struct SourceInfo {
pub density: Option<Density>,
pub progressive: bool,
pub palette: bool,
pub bits_per_sample: Option<u8>,
pub chroma_subsampling: Option<&'static str>,
pub background: Option<Background>,
pub compression: Option<&'static str>,
pub comments: Vec<Comment>,
}Expand description
What a decoder learned about its file from the header, beyond the pixel
layout: the facts sharp’s metadata() reports per format. Every field is
empty for a format with no notion of it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.density: Option<Density>The stated resolution, if any (JPEG’s JFIF or EXIF, PNG’s pHYs,
TIFF’s tags).
progressive: boolProgressive JPEG, or interlaced PNG and GIF.
palette: boolSamples are indices into a palette (PNG colour type 3, GIF, TIFF palette).
bits_per_sample: Option<u8>Bits per stored sample, which may be fewer than the output’s (a 10-bit AVIF, a 4-bit PNG).
chroma_subsampling: Option<&'static str>Chroma subsampling as sharp spells it ("4:2:0", "4:4:4", …),
for formats that subsample.
background: Option<Background>The background colour the file names (PNG bKGD, GIF’s).
compression: Option<&'static str>The compression scheme, where a format has several (TIFF, AVIF).
comments: Vec<Comment>Text entries (PNG tEXt, zTXt, iTXt; GIF and JPEG comments).
Trait Implementations§
Source§impl Clone for SourceInfo
impl Clone for SourceInfo
Source§fn clone(&self) -> SourceInfo
fn clone(&self) -> SourceInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceInfo
impl Debug for SourceInfo
Source§impl Default for SourceInfo
impl Default for SourceInfo
Source§fn default() -> SourceInfo
fn default() -> SourceInfo
Returns the “default value” for a type. Read more
Source§impl PartialEq for SourceInfo
impl PartialEq for SourceInfo
impl StructuralPartialEq for SourceInfo
Auto Trait Implementations§
impl Freeze for SourceInfo
impl RefUnwindSafe for SourceInfo
impl Send for SourceInfo
impl Sync for SourceInfo
impl Unpin for SourceInfo
impl UnsafeUnpin for SourceInfo
impl UnwindSafe for SourceInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more