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: u32The picture’s width in pixels
height: u32The picture’s height in pixels
color_depth: u32The picture’s color depth in bits per pixel
num_colors: u32The number of colors used
Implementations§
Source§impl PictureInformation
impl PictureInformation
Sourcepub fn from_picture(picture: &Picture) -> Result<Self>
pub fn from_picture(picture: &Picture) -> Result<Self>
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
picture.datais less than 8 bytes in length- See
PictureInformation::from_pngandPictureInformation::from_jpeg
Trait Implementations§
Source§impl Clone for PictureInformation
impl Clone for PictureInformation
Source§fn clone(&self) -> PictureInformation
fn clone(&self) -> PictureInformation
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PictureInformation
impl Debug for PictureInformation
Source§impl Default for PictureInformation
impl Default for PictureInformation
Source§fn default() -> PictureInformation
fn default() -> PictureInformation
Returns the “default value” for a type. Read more
Source§impl Hash for PictureInformation
impl Hash for PictureInformation
Source§impl PartialEq for PictureInformation
impl PartialEq for PictureInformation
impl Copy for PictureInformation
impl Eq for PictureInformation
impl StructuralPartialEq for PictureInformation
Auto Trait Implementations§
impl Freeze for PictureInformation
impl RefUnwindSafe for PictureInformation
impl Send for PictureInformation
impl Sync for PictureInformation
impl Unpin for PictureInformation
impl UnwindSafe for PictureInformation
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