use alloc::vec::Vec;
use crate::{J2kRect, J2kWaveletTransform};
pub type J2kDirectBandId = u32;
#[derive(Debug, Clone)]
pub enum J2kDirectGrayscaleStep {
ClassicSubBand(J2kOwnedSubBandPlan),
HtSubBand(HtOwnedSubBandPlan),
Idwt(J2kDirectIdwtStep),
Store(J2kDirectStoreStep),
}
#[derive(Debug, Clone)]
pub struct J2kDirectGrayscalePlan {
pub dimensions: (u32, u32),
pub bit_depth: u8,
pub steps: Vec<J2kDirectGrayscaleStep>,
}
#[derive(Debug, Clone)]
pub struct J2kDirectColorPlan {
pub dimensions: (u32, u32),
pub bit_depths: [u8; 3],
pub mct: bool,
pub transform: J2kWaveletTransform,
pub component_plans: Vec<J2kDirectGrayscalePlan>,
}
#[derive(Debug, Clone)]
pub struct J2kOwnedSubBandPlan {
pub band_id: J2kDirectBandId,
pub rect: J2kRect,
pub width: u32,
pub height: u32,
pub jobs: Vec<J2kOwnedCodeBlockBatchJob>,
}
#[derive(Debug, Clone)]
pub struct HtOwnedSubBandPlan {
pub band_id: J2kDirectBandId,
pub rect: J2kRect,
pub width: u32,
pub height: u32,
pub jobs: Vec<HtOwnedCodeBlockBatchJob>,
}
#[derive(Debug, Clone)]
pub struct J2kOwnedCodeBlockBatchJob {
pub output_x: u32,
pub output_y: u32,
pub data: Vec<u8>,
pub segments: Vec<crate::J2kCodeBlockSegment>,
pub width: u32,
pub height: u32,
pub output_stride: usize,
pub missing_bit_planes: u8,
pub number_of_coding_passes: u8,
pub total_bitplanes: u8,
pub roi_shift: u8,
pub sub_band_type: crate::J2kSubBandType,
pub style: crate::J2kCodeBlockStyle,
pub strict: bool,
pub dequantization_step: f32,
}
#[derive(Debug, Clone)]
pub struct HtOwnedCodeBlockBatchJob {
pub output_x: u32,
pub output_y: u32,
pub data: Vec<u8>,
pub cleanup_length: u32,
pub refinement_length: u32,
pub width: u32,
pub height: u32,
pub output_stride: usize,
pub missing_bit_planes: u8,
pub number_of_coding_passes: u8,
pub num_bitplanes: u8,
pub roi_shift: u8,
pub stripe_causal: bool,
pub strict: bool,
pub dequantization_step: f32,
}
#[derive(Debug, Clone, Copy)]
pub struct J2kDirectIdwtStep {
pub output_band_id: J2kDirectBandId,
pub rect: J2kRect,
pub transform: J2kWaveletTransform,
pub ll_band_id: J2kDirectBandId,
pub ll: J2kRect,
pub hl_band_id: J2kDirectBandId,
pub hl: J2kRect,
pub lh_band_id: J2kDirectBandId,
pub lh: J2kRect,
pub hh_band_id: J2kDirectBandId,
pub hh: J2kRect,
}
#[derive(Debug, Clone, Copy)]
pub struct J2kDirectStoreStep {
pub input_band_id: J2kDirectBandId,
pub input_rect: J2kRect,
pub source_x: u32,
pub source_y: u32,
pub copy_width: u32,
pub copy_height: u32,
pub output_width: u32,
pub output_height: u32,
pub output_x: u32,
pub output_y: u32,
pub addend: f32,
}