pub struct ImageHeader {
pub width: u32,
pub height: u32,
pub bit_depth: u8,
pub color_type: ColorType,
pub compression: u8,
pub filter_method: u8,
pub interlace: u8,
}Expand description
PNG image header (IHDR chunk).
Fields§
§width: u32Image width in pixels.
height: u32Image height in pixels.
bit_depth: u8Bit depth.
color_type: ColorTypeColor type.
compression: u8Compression method (always 0 for PNG).
filter_method: u8Filter method (always 0 for PNG).
interlace: u8Interlace method (0 = none, 1 = Adam7).
Implementations§
Source§impl ImageHeader
impl ImageHeader
Sourcepub fn parse(data: &[u8]) -> CodecResult<Self>
pub fn parse(data: &[u8]) -> CodecResult<Self>
Sourcepub fn bytes_per_pixel(&self) -> usize
pub fn bytes_per_pixel(&self) -> usize
Get bytes per pixel (rounded up).
Sourcepub fn scanline_length(&self) -> usize
pub fn scanline_length(&self) -> usize
Get scanline length in bytes.
Trait Implementations§
Source§impl Clone for ImageHeader
impl Clone for ImageHeader
Source§fn clone(&self) -> ImageHeader
fn clone(&self) -> ImageHeader
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for ImageHeader
impl RefUnwindSafe for ImageHeader
impl Send for ImageHeader
impl Sync for ImageHeader
impl Unpin for ImageHeader
impl UnsafeUnpin for ImageHeader
impl UnwindSafe for ImageHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more