Struct lofty::PictureInformation
source · [−]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: 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
sourceimpl 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
sourceimpl Clone for PictureInformation
impl Clone for PictureInformation
sourcefn clone(&self) -> PictureInformation
fn clone(&self) -> PictureInformation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for PictureInformation
impl Debug for PictureInformation
sourceimpl Default for PictureInformation
impl Default for PictureInformation
sourcefn default() -> PictureInformation
fn default() -> PictureInformation
Returns the “default value” for a type. Read more
sourceimpl Hash for PictureInformation
impl Hash for PictureInformation
sourceimpl PartialEq<PictureInformation> for PictureInformation
impl PartialEq<PictureInformation> for PictureInformation
sourcefn eq(&self, other: &PictureInformation) -> bool
fn eq(&self, other: &PictureInformation) -> bool
impl Copy for PictureInformation
impl Eq for PictureInformation
impl StructuralEq for PictureInformation
impl StructuralPartialEq for PictureInformation
Auto Trait Implementations
impl RefUnwindSafe for PictureInformation
impl Send for PictureInformation
impl Sync for PictureInformation
impl Unpin for PictureInformation
impl UnwindSafe for PictureInformation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more