Skip to main content

FrameInfo

Struct FrameInfo 

Source
pub struct FrameInfo {
    pub precision: u8,
    pub height: u16,
    pub width: u16,
    pub components: Vec<Component>,
    pub max_h_sampling: u8,
    pub max_v_sampling: u8,
    pub mcu_width: u16,
    pub mcu_height: u16,
    pub mcus_wide: u16,
    pub mcus_tall: u16,
    pub is_progressive: bool,
}
Expand description

Frame information parsed from SOF0/SOF2 marker.

Fields§

§precision: u8

Sample precision in bits (must be 8).

§height: u16

Image height in pixels.

§width: u16

Image width in pixels.

§components: Vec<Component>

Components in the frame.

§max_h_sampling: u8

Maximum horizontal sampling factor across all components.

§max_v_sampling: u8

Maximum vertical sampling factor across all components.

§mcu_width: u16

MCU width in blocks (= max_h_sampling * 8 pixels).

§mcu_height: u16

MCU height in blocks (= max_v_sampling * 8 pixels).

§mcus_wide: u16

Number of MCUs horizontally.

§mcus_tall: u16

Number of MCUs vertically.

§is_progressive: bool

Whether this is a progressive JPEG (SOF2). False for baseline (SOF0).

Implementations§

Source§

impl FrameInfo

Source

pub fn blocks_wide(&self, comp_idx: usize) -> usize

Number of 8×8 blocks wide for a given component.

Source

pub fn blocks_tall(&self, comp_idx: usize) -> usize

Number of 8×8 blocks tall for a given component.

Trait Implementations§

Source§

impl Clone for FrameInfo

Source§

fn clone(&self) -> FrameInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FrameInfo

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V