pub struct PictureInformation {
    pub width: u32,
    pub height: u32,
    pub color_depth: u32,
    pub num_colors: u32,
}
Available on crate feature vorbis_comments only.
Expand description

Information about a Picture

This information is necessary for FLAC’s METADATA_BLOCK_PICTURE. See Picture::as_flac_bytes for more information.

Fields

width: u32

The picture’s width in pixels

height: u32

The picture’s height in pixels

color_depth: u32

The picture’s color depth in bits per pixel

num_colors: u32

The number of colors used

Implementations

Attempt to extract PictureInformation from a Picture

NOTE: This only supports PNG and JPEG images. If another image is provided, the PictureInformation will be zeroed out.

Errors

Attempt to extract PictureInformation from a PNG

Errors
  • reader is not a valid PNG

Attempt to extract PictureInformation from a JPEG

Errors
  • reader is not a JPEG image
  • reader does not contain a SOFn frame

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.