pub struct ParamCod { /* private fields */ }Expand description
COD/COC marker segment — coding style parameters.
Holds default coding parameters (COD) and optionally per-component overrides (COC). Controls the wavelet transform, block coder settings, precinct sizes, and progression order.
Implementations§
Source§impl ParamCod
impl ParamCod
Sourcepub fn new_coc(comp_idx: u16) -> Self
pub fn new_coc(comp_idx: u16) -> Self
Creates a new COC (coding style component) instance for the given component index.
Sourcepub fn set_reversible(&mut self, reversible: bool)
pub fn set_reversible(&mut self, reversible: bool)
Sets whether the wavelet transform is reversible (lossless 5/3) or irreversible (lossy 9/7).
Sourcepub fn set_color_transform(&mut self, ct: bool)
pub fn set_color_transform(&mut self, ct: bool)
Enables or disables the multi-component (color) transform.
When enabled with a reversible transform, RCT is used; with irreversible, ICT is used. Requires ≥ 3 components.
Sourcepub fn set_num_decomposition(&mut self, num: u32)
pub fn set_num_decomposition(&mut self, num: u32)
Sets the number of DWT decomposition levels (0–32).
Sourcepub fn set_block_dims(&mut self, width: u32, height: u32)
pub fn set_block_dims(&mut self, width: u32, height: u32)
Sets the code block dimensions. Both width and height must be
powers of two in the range 4–1024 and their product ≤ 4096.
Sourcepub fn set_precinct_size(&mut self, num_levels: i32, sizes: &[Size])
pub fn set_precinct_size(&mut self, num_levels: i32, sizes: &[Size])
Sets custom precinct sizes per resolution level.
Sourcepub fn set_progression_order(&mut self, name: &str) -> Result<()>
pub fn set_progression_order(&mut self, name: &str) -> Result<()>
Sets the progression order by name (e.g. "LRCP", "RPCL").
§Errors
Returns OjphError::InvalidParam if name is not a recognised
progression order string.
Sourcepub fn get_num_decompositions(&self) -> u8
pub fn get_num_decompositions(&self) -> u8
Returns the number of DWT decomposition levels.
Sourcepub fn get_block_dims(&self) -> Size
pub fn get_block_dims(&self) -> Size
Returns the code block dimensions.
Sourcepub fn get_log_block_dims(&self) -> Size
pub fn get_log_block_dims(&self) -> Size
Returns the log₂ code block dimensions.
Sourcepub fn get_wavelet_kern(&self) -> u8
pub fn get_wavelet_kern(&self) -> u8
Returns the wavelet kernel type (0 = irreversible 9/7, 1 = reversible 5/3).
Sourcepub fn is_reversible(&self) -> bool
pub fn is_reversible(&self) -> bool
Returns true if using the reversible (lossless) 5/3 wavelet.
Sourcepub fn is_employing_color_transform(&self) -> bool
pub fn is_employing_color_transform(&self) -> bool
Returns true if the multi-component color transform is enabled.
Sourcepub fn get_precinct_size(&self, res_num: u32) -> Size
pub fn get_precinct_size(&self, res_num: u32) -> Size
Returns the precinct size at the given resolution level.
Sourcepub fn get_log_precinct_size(&self, res_num: u32) -> Size
pub fn get_log_precinct_size(&self, res_num: u32) -> Size
Returns the log₂ precinct size at the given resolution level.
Sourcepub fn packets_may_use_sop(&self) -> bool
pub fn packets_may_use_sop(&self) -> bool
Returns true if SOP markers may be used in packets.
Sourcepub fn packets_use_eph(&self) -> bool
pub fn packets_use_eph(&self) -> bool
Returns true if EPH markers are used in packets.
Sourcepub fn get_block_vertical_causality(&self) -> bool
pub fn get_block_vertical_causality(&self) -> bool
Returns true if vertical causal context is enabled.
Sourcepub fn get_progression_order(&self) -> i32
pub fn get_progression_order(&self) -> i32
Returns the progression order as an integer.
Sourcepub fn get_progression_order_as_string(&self) -> &'static str
pub fn get_progression_order_as_string(&self) -> &'static str
Returns the progression order as a four-character string.
Sourcepub fn get_num_layers(&self) -> i32
pub fn get_num_layers(&self) -> i32
Returns the number of quality layers.
Sourcepub fn is_dfs_defined(&self) -> bool
pub fn is_dfs_defined(&self) -> bool
Returns true if a DFS marker is referenced.
Sourcepub fn get_dfs_index(&self) -> u16
pub fn get_dfs_index(&self) -> u16
Returns the DFS marker index.
Sourcepub fn get_comp_idx(&self) -> u16
pub fn get_comp_idx(&self) -> u16
Returns the component index this COC applies to.
Sourcepub fn get_coc(&self, comp_idx: u32) -> &ParamCod
pub fn get_coc(&self, comp_idx: u32) -> &ParamCod
Returns the COC for a specific component, falling back to the COD defaults if no per-component override exists.
Sourcepub fn get_coc_mut(&mut self, comp_idx: u32) -> &mut ParamCod
pub fn get_coc_mut(&mut self, comp_idx: u32) -> &mut ParamCod
Returns a mutable reference to the COC for a specific component.
Sourcepub fn add_coc(&mut self, comp_idx: u32) -> &mut ParamCod
pub fn add_coc(&mut self, comp_idx: u32) -> &mut ParamCod
Adds a new COC override for the specified component.