Skip to main content

j2k_types/transform/
dwt97.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3//! Irreversible 9/7 forward-wavelet contracts.
4
5use alloc::vec::Vec;
6
7/// Forward irreversible 9/7 DWT job.
8#[derive(Debug, Clone, Copy)]
9pub struct J2kForwardDwt97Job<'a> {
10    /// Source samples in row-major order.
11    pub samples: &'a [f32],
12    /// Source width in samples.
13    pub width: u32,
14    /// Source height in samples.
15    pub height: u32,
16    /// Number of decomposition levels requested.
17    pub num_levels: u8,
18}
19
20/// Forward irreversible 9/7 DWT output.
21#[derive(Debug)]
22pub struct J2kForwardDwt97Output {
23    /// LL subband coefficients from the lowest decomposition level.
24    pub ll: Vec<f32>,
25    /// LL subband width.
26    pub ll_width: u32,
27    /// LL subband height.
28    pub ll_height: u32,
29    /// Higher resolution detail levels, ordered from lowest to highest.
30    pub levels: Vec<J2kForwardDwt97Level>,
31}
32
33/// One irreversible 9/7 DWT detail level.
34#[derive(Debug)]
35pub struct J2kForwardDwt97Level {
36    /// HL subband coefficients.
37    pub hl: Vec<f32>,
38    /// LH subband coefficients.
39    pub lh: Vec<f32>,
40    /// HH subband coefficients.
41    pub hh: Vec<f32>,
42    /// Full-resolution width represented by this level.
43    pub width: u32,
44    /// Full-resolution height represented by this level.
45    pub height: u32,
46    /// Low-pass width at this level.
47    pub low_width: u32,
48    /// Low-pass height at this level.
49    pub low_height: u32,
50    /// High-pass width at this level.
51    pub high_width: u32,
52    /// High-pass height at this level.
53    pub high_height: u32,
54}
55
56crate::move_only::assert_move_only!(J2kForwardDwt97Output, J2kForwardDwt97Level);