Struct lofty::PictureInformation[][src]

pub struct PictureInformation {
    pub width: u32,
    pub height: u32,
    pub color_depth: u32,
    pub num_colors: u32,
}
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: Since FLAC only supports PNG and JPEG, this function is no different.

Errors

Attempt to extract PictureInformation from a PNG

Errors
  • reader does not start with a PNG signature
  • 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 !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.