pub struct CpuBatchDecoder { /* private fields */ }Expand description
Persistent CPU facade for repeated owned/prepared batch decode.
Prepared metadata is borrowed across calls. Decoder settings and worker policy are retained by the session. Each worker owns a lifetime-free native workspace whose decoded-component, Tier-1, and IDWT allocations move through the borrowing context and return to the worker after every group, including across calls. Supported Gray/RGB/RGBA classic and HTJ2K inputs execute their retained per-tile offset plans directly. Metadata-only inputs retain the general decode fallback.
Implementations§
Source§impl CpuBatchDecoder
impl CpuBatchDecoder
Sourcepub fn new(options: BatchDecodeOptions) -> Self
pub fn new(options: BatchDecodeOptions) -> Self
Create a persistent CPU batch decoder.
Sourcepub const fn options(&self) -> BatchDecodeOptions
pub const fn options(&self) -> BatchDecodeOptions
Retained session options.
Sourcepub fn retained_worker_count(&self) -> usize
pub fn retained_worker_count(&self) -> usize
Number of reusable worker context/scratch owners retained by this session.
Sourcepub fn workspace_stats(&self) -> CpuBatchWorkspaceStats
pub fn workspace_stats(&self) -> CpuBatchWorkspaceStats
Aggregate native workspace reuse counters for this session.
Sourcepub fn prepare(
&self,
inputs: Vec<EncodedImage>,
) -> Result<PreparedBatch, BatchInfrastructureError>
pub fn prepare( &self, inputs: Vec<EncodedImage>, ) -> Result<PreparedBatch, BatchInfrastructureError>
Inspect and group owned encoded inputs for repeated decode.
Sourcepub fn prepare_prepared_images(
&self,
images: Vec<PreparedImage>,
) -> Result<PreparedBatch, BatchInfrastructureError>
pub fn prepare_prepared_images( &self, images: Vec<PreparedImage>, ) -> Result<PreparedBatch, BatchInfrastructureError>
Regroup caller-supplied prepared images under this session’s output policy.
Sourcepub fn decode(
&mut self,
inputs: Vec<EncodedImage>,
) -> Result<CpuBatchDecodeResult, BatchInfrastructureError>
pub fn decode( &mut self, inputs: Vec<EncodedImage>, ) -> Result<CpuBatchDecodeResult, BatchInfrastructureError>
Prepare and decode one batch.
Sourcepub fn decode_prepared_images(
&mut self,
images: Vec<PreparedImage>,
) -> Result<CpuBatchDecodeResult, BatchInfrastructureError>
pub fn decode_prepared_images( &mut self, images: Vec<PreparedImage>, ) -> Result<CpuBatchDecodeResult, BatchInfrastructureError>
Regroup and decode caller-supplied prepared images without reparsing them.
Sourcepub fn decode_prepared(
&mut self,
prepared: &PreparedBatch,
) -> Result<CpuBatchDecodeResult, BatchInfrastructureError>
pub fn decode_prepared( &mut self, prepared: &PreparedBatch, ) -> Result<CpuBatchDecodeResult, BatchInfrastructureError>
Decode a previously prepared batch without consuming it.
Trait Implementations§
Source§impl BatchDecoder for CpuBatchDecoder
impl BatchDecoder for CpuBatchDecoder
Source§type Output = CpuBatchDecodeResult
type Output = CpuBatchDecodeResult
Source§type Error = BatchInfrastructureError
type Error = BatchInfrastructureError
Source§fn options(&self) -> BatchDecodeOptions
fn options(&self) -> BatchDecodeOptions
Source§fn prepare_batch(
&self,
inputs: Vec<EncodedImage>,
) -> Result<PreparedBatch, Self::Error>
fn prepare_batch( &self, inputs: Vec<EncodedImage>, ) -> Result<PreparedBatch, Self::Error>
Source§fn prepare_prepared_images(
&self,
images: Vec<PreparedImage>,
) -> Result<PreparedBatch, Self::Error>
fn prepare_prepared_images( &self, images: Vec<PreparedImage>, ) -> Result<PreparedBatch, Self::Error>
Source§fn decode_prepared(
&mut self,
prepared: &PreparedBatch,
) -> Result<Self::Output, Self::Error>
fn decode_prepared( &mut self, prepared: &PreparedBatch, ) -> Result<Self::Output, Self::Error>
Source§fn decode_batch(
&mut self,
inputs: Vec<EncodedImage>,
) -> Result<Self::Output, Self::Error>
fn decode_batch( &mut self, inputs: Vec<EncodedImage>, ) -> Result<Self::Output, Self::Error>
Source§fn decode_prepared_images(
&mut self,
images: Vec<PreparedImage>,
) -> Result<Self::Output, Self::Error>
fn decode_prepared_images( &mut self, images: Vec<PreparedImage>, ) -> Result<Self::Output, Self::Error>
Auto Trait Implementations§
impl !Freeze for CpuBatchDecoder
impl !RefUnwindSafe for CpuBatchDecoder
impl !UnwindSafe for CpuBatchDecoder
impl Send for CpuBatchDecoder
impl Sync for CpuBatchDecoder
impl Unpin for CpuBatchDecoder
impl UnsafeUnpin for CpuBatchDecoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more