Skip to main content

HtCodeBlockDecoder

Trait HtCodeBlockDecoder 

Source
pub trait HtCodeBlockDecoder {
    // Required method
    fn decode_code_block(
        &mut self,
        job: HtCodeBlockDecodeJob<'_>,
        output: &mut [f32],
    ) -> Result<()>;

    // Provided methods
    fn decode_j2k_sub_band(
        &mut self,
        _job: J2kSubBandDecodeJob<'_>,
        _output: &mut [f32],
    ) -> Result<bool> { ... }
    fn decode_j2k_code_block(
        &mut self,
        _job: J2kCodeBlockDecodeJob<'_>,
        _output: &mut [f32],
    ) -> Result<bool> { ... }
    fn decode_sub_band(
        &mut self,
        _job: HtSubBandDecodeJob<'_>,
        _output: &mut [f32],
    ) -> Result<bool> { ... }
    fn decode_single_decomposition_idwt(
        &mut self,
        _job: J2kSingleDecompositionIdwtJob<'_>,
        _output: &mut [f32],
    ) -> Result<bool> { ... }
    fn decode_inverse_mct(&mut self, _job: J2kInverseMctJob<'_>) -> Result<bool> { ... }
    fn decode_store_component(
        &mut self,
        _job: J2kStoreComponentJob<'_>,
    ) -> Result<bool> { ... }
}
Expand description

Adapter HTJ2K code-block decode hook for backend experimentation.

Required Methods§

Source

fn decode_code_block( &mut self, job: HtCodeBlockDecodeJob<'_>, output: &mut [f32], ) -> Result<()>

Decode one HTJ2K code block into output, writing job.width samples per row.

Provided Methods§

Source

fn decode_j2k_sub_band( &mut self, _job: J2kSubBandDecodeJob<'_>, _output: &mut [f32], ) -> Result<bool>

Optionally decode a full classic J2K sub-band in one batch.

Implementations should return Ok(true) if they handled the request and wrote the decoded coefficients into output. Returning Ok(false) falls back to per-code-block decode via decode_j2k_code_block.

Source

fn decode_j2k_code_block( &mut self, _job: J2kCodeBlockDecodeJob<'_>, _output: &mut [f32], ) -> Result<bool>

Optionally decode one classic J2K code block.

Implementations should return Ok(true) if they handled the request and wrote the decoded coefficients into output. Returning Ok(false) falls back to the scalar bitplane decoder.

Source

fn decode_sub_band( &mut self, _job: HtSubBandDecodeJob<'_>, _output: &mut [f32], ) -> Result<bool>

Optionally decode a full HTJ2K sub-band in one batch.

Implementations should return Ok(true) if they handled the request and wrote the decoded coefficients into output. Returning Ok(false) falls back to per-code-block decode via decode_code_block.

Source

fn decode_single_decomposition_idwt( &mut self, _job: J2kSingleDecompositionIdwtJob<'_>, _output: &mut [f32], ) -> Result<bool>

Optionally decode one single-decomposition IDWT level on a backend.

Implementations should return Ok(true) if they handled the request and wrote the transformed coefficients into output. Returning Ok(false) falls back to the scalar/SIMD CPU IDWT path.

Source

fn decode_inverse_mct(&mut self, _job: J2kInverseMctJob<'_>) -> Result<bool>

Optionally apply inverse MCT on a backend.

Implementations should return Ok(true) if they handled the request and updated the component planes in place. Returning Ok(false) falls back to the scalar/SIMD CPU MCT path.

Source

fn decode_store_component( &mut self, _job: J2kStoreComponentJob<'_>, ) -> Result<bool>

Optionally store one component plane on a backend.

Implementations should return Ok(true) if they handled the request and updated the destination plane in place. Returning Ok(false) falls back to the CPU store path.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§