Struct lofty::PictureInformation
source · 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§
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.data
is less than 8 bytes in length- See
PictureInformation::from_png
andPictureInformation::from_jpeg
Trait Implementations§
source§impl Clone for PictureInformation
impl Clone for PictureInformation
source§fn clone(&self) -> PictureInformation
fn clone(&self) -> PictureInformation
Returns a copy of the value. Read more
1.0.0 · 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 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
source§fn eq(&self, other: &PictureInformation) -> bool
fn eq(&self, other: &PictureInformation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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§
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