Skip to main content

Header

Struct Header 

Source
pub struct Header {
Show 17 fields pub version: u32, pub width: u32, pub height: u32, pub layers: u16, pub channels: u16, pub bit_depth: u8, pub is_signed: bool, pub quality: u16, pub chroma_scale: u8, pub block_size: u8, pub filter: Filter, pub quantization: Quantization, pub encoder: Encoder, pub intent: Intent, pub metadata_size: u32, pub channel_size: usize, pub image_size: usize,
}

Fields§

§version: u32§width: u32§height: u32§layers: u16§channels: u16§bit_depth: u8§is_signed: bool§quality: u16§chroma_scale: u8§block_size: u8§filter: Filter§quantization: Quantization§encoder: Encoder§intent: Intent§metadata_size: u32§channel_size: usize§image_size: usize

Implementations§

Source§

impl Header

Source

pub fn decode(encoded: &mut impl Read) -> Result<Header, HeaderErr>

Source

pub fn encode(&self, buff: &mut impl Write) -> Result<()>

Source

pub fn get_decompress_buffer_size(&self, downsampling: usize) -> usize

Source

pub fn get_boost(&self) -> i16

Source

pub fn get_downsampled_width(&self, downsampling: usize) -> usize

Source

pub fn get_downsampled_height(&self, downsampling: usize) -> usize

Source

pub fn get_downsampled_channel_size(&self, downsampling: usize) -> usize

Source

pub fn get_channel_size(&self) -> usize

Source

pub fn get_chroma_quality(&self) -> i32

Source

pub fn get_image_size(&self) -> usize

Source

pub fn get_downsampled_image_size(&self, downsampling: usize) -> usize

Trait Implementations§

Source§

impl Debug for Header

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Header

Source§

fn eq(&self, other: &Header) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Header

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.