use j2k_core::{CacheStats, CodecContext};
use crate::CpuDecodeParallelism;
#[derive(Debug, Default, Clone)]
pub struct J2kContext {
cpu_decode_parallelism: CpuDecodeParallelism,
}
impl J2kContext {
pub const fn new() -> Self {
Self {
cpu_decode_parallelism: CpuDecodeParallelism::Auto,
}
}
pub fn cpu_decode_parallelism(&self) -> CpuDecodeParallelism {
self.cpu_decode_parallelism
}
pub fn set_cpu_decode_parallelism(&mut self, parallelism: CpuDecodeParallelism) {
self.cpu_decode_parallelism = parallelism;
}
}
impl CodecContext for J2kContext {
fn clear(&mut self) {
self.cpu_decode_parallelism = CpuDecodeParallelism::Auto;
}
fn cache_stats(&self) -> CacheStats {
CacheStats::default()
}
}