pub(crate) struct Components {Show 23 fields
pub component_id: ComponentID,
pub vertical_sample: usize,
pub horizontal_sample: usize,
pub dc_huff_table: usize,
pub ac_huff_table: usize,
pub quantization_table_number: u8,
pub quantization_table: [i32; 64],
pub dc_pred: i32,
pub up_sampler: fn(input: &[i16], in_near: &[i16], in_far: &[i16], scratch_space: &mut [i16], output: &mut [i16]),
pub width_stride: usize,
pub id: u8,
pub needed: bool,
pub raw_coeff: Vec<i16>,
pub upsample_dest: Vec<i16>,
pub row_up: Vec<i16>,
pub row: Vec<i16>,
pub first_row_upsample_dest: Vec<i16>,
pub idct_pos: usize,
pub x: usize,
pub w2: usize,
pub y: usize,
pub sample_ratio: SampleRatios,
pub fix_an_annoying_bug: usize,
}
Expand description
Component Data from start of frame
Fields§
§component_id: ComponentID
The type of component that has the metadata below, can be Y,Cb or Cr
vertical_sample: usize
Sub-sampling ratio of this component in the x-plane
horizontal_sample: usize
Sub-sampling ratio of this component in the y-plane
dc_huff_table: usize
DC huffman table position
ac_huff_table: usize
AC huffman table position for this element.
quantization_table_number: u8
Quantization table number
quantization_table: [i32; 64]
Specifies quantization table to use with this component
dc_pred: i32
dc prediction for the component
up_sampler: fn(input: &[i16], in_near: &[i16], in_far: &[i16], scratch_space: &mut [i16], output: &mut [i16])
An up-sampling function, can be basic or SSE, depending on the platform
width_stride: usize
How pixels do we need to go to get to the next line?
id: u8
Component ID for progressive
needed: bool
Whether we need to decode this image component.
raw_coeff: Vec<i16>
Upsample scanline
upsample_dest: Vec<i16>
Upsample destination, stores a scanline worth of sub sampled data
row_up: Vec<i16>
previous row, used to handle MCU boundaries
row: Vec<i16>
current row, used to handle MCU boundaries again
first_row_upsample_dest: Vec<i16>
§idct_pos: usize
§x: usize
§w2: usize
§y: usize
§sample_ratio: SampleRatios
§fix_an_annoying_bug: usize
Implementations§
Source§impl Components
impl Components
Sourcepub fn from(a: [u8; 3], pos: u8) -> Result<Components, DecodeErrors>
pub fn from(a: [u8; 3], pos: u8) -> Result<Components, DecodeErrors>
Create a new instance from three bytes from the start of frame
Sourcepub fn setup_upsample_scanline(&mut self)
pub fn setup_upsample_scanline(&mut self)
Setup space for upsampling
During upsample, we need a reference of the last row so that upsampling can proceed correctly, so we store the last line of every scanline and use it for the next upsampling procedure to store this, but since we don’t need it for 1v1 upsampling, we only call this for routines that need upsampling
§Requirements
- width stride of this element is set for the component.
Trait Implementations§
Source§impl Clone for Components
impl Clone for Components
Source§fn clone(&self) -> Components
fn clone(&self) -> Components
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more