pub struct JpegBatchSession { /* private fields */ }Expand description
Reusable JPEG tile-batch runtime for WSI viewport loops.
The session keeps one decoder context and scratch pool per active worker during a batch and retains worker slots across calls. Before planning the next batch it may preserve one bounded decoder context, while evicting stale scratch and other contexts so the planning decoder retains the full codec memory allowance. Callers continue to own compressed inputs and decoded output buffers.
Implementations§
Source§impl JpegBatchSession
impl JpegBatchSession
Sourcepub fn new(options: TileBatchOptions) -> Self
pub fn new(options: TileBatchOptions) -> Self
Create a session using the given CPU batch worker options.
Sourcepub fn options(&self) -> TileBatchOptions
pub fn options(&self) -> TileBatchOptions
Return current worker options.
Sourcepub fn set_options(&mut self, options: TileBatchOptions)
pub fn set_options(&mut self, options: TileBatchOptions)
Replace worker options for future decode calls.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Clear worker-local decode contexts and scratch pools while retaining slots.
Sourcepub fn decode_tiles_into(
&mut self,
jobs: &mut [TileDecodeJob<'_, '_>],
fmt: PixelFormat,
) -> Result<Vec<DecodeOutcome>, TileBatchError>
pub fn decode_tiles_into( &mut self, jobs: &mut [TileDecodeJob<'_, '_>], fmt: PixelFormat, ) -> Result<Vec<DecodeOutcome>, TileBatchError>
Decode full JPEG tiles into caller-owned output buffers.
§Errors
Returns TileBatchError with the first codec failure in input order,
or a typed infrastructure failure when no tile index applies.
Sourcepub fn decode_tiles_into_with_options(
&mut self,
jobs: &mut [TileDecodeJob<'_, '_>],
fmt: PixelFormat,
decode_options: DecodeOptions,
) -> Result<Vec<DecodeOutcome>, TileBatchError>
pub fn decode_tiles_into_with_options( &mut self, jobs: &mut [TileDecodeJob<'_, '_>], fmt: PixelFormat, decode_options: DecodeOptions, ) -> Result<Vec<DecodeOutcome>, TileBatchError>
Decode full JPEG tiles with explicit JPEG decode options.
§Errors
Returns TileBatchError with the first codec failure in input order,
or a typed infrastructure failure when no tile index applies.
Sourcepub fn decode_prepared_jpeg_tiles_rgb8(
&mut self,
jobs: &mut [PreparedJpegTileJob<'_, '_>],
) -> Result<Vec<Result<DecodedTile, JpegError>>, BatchInfrastructureError>
pub fn decode_prepared_jpeg_tiles_rgb8( &mut self, jobs: &mut [PreparedJpegTileJob<'_, '_>], ) -> Result<Vec<Result<DecodedTile, JpegError>>, BatchInfrastructureError>
Decode prepared TIFF/WSI JPEG tiles into caller-owned RGB8 buffers.
Results preserve the caller’s input order and retain each tile’s error independently instead of collapsing the batch to the first failure.
§Errors
Returns a typed batch infrastructure error for planning, allocation, scheduling, or ordered-collection failures.
Sourcepub fn decode_tiles_scaled_into(
&mut self,
jobs: &mut [TileScaledDecodeJob<'_, '_>],
fmt: PixelFormat,
) -> Result<Vec<DecodeOutcome>, TileBatchError>
pub fn decode_tiles_scaled_into( &mut self, jobs: &mut [TileScaledDecodeJob<'_, '_>], fmt: PixelFormat, ) -> Result<Vec<DecodeOutcome>, TileBatchError>
Decode scaled JPEG tiles into caller-owned output buffers.
§Errors
Returns TileBatchError with the first codec failure in input order,
or a typed infrastructure failure when no tile index applies.
Sourcepub fn decode_tiles_scaled_into_with_options(
&mut self,
jobs: &mut [TileScaledDecodeJob<'_, '_>],
fmt: PixelFormat,
decode_options: DecodeOptions,
) -> Result<Vec<DecodeOutcome>, TileBatchError>
pub fn decode_tiles_scaled_into_with_options( &mut self, jobs: &mut [TileScaledDecodeJob<'_, '_>], fmt: PixelFormat, decode_options: DecodeOptions, ) -> Result<Vec<DecodeOutcome>, TileBatchError>
Decode scaled JPEG tiles with explicit JPEG decode options.
§Errors
Returns TileBatchError with the first codec failure in input order,
or a typed infrastructure failure when no tile index applies.
Sourcepub fn decode_tiles_region_scaled_into(
&mut self,
jobs: &mut [TileRegionScaledDecodeJob<'_, '_>],
fmt: PixelFormat,
) -> Result<Vec<DecodeOutcome>, TileBatchError>
pub fn decode_tiles_region_scaled_into( &mut self, jobs: &mut [TileRegionScaledDecodeJob<'_, '_>], fmt: PixelFormat, ) -> Result<Vec<DecodeOutcome>, TileBatchError>
Decode scaled JPEG tile regions into caller-owned output buffers.
§Errors
Returns TileBatchError with the first codec failure in input order,
or a typed infrastructure failure when no tile index applies.
Sourcepub fn decode_tiles_region_scaled_into_with_options(
&mut self,
jobs: &mut [TileRegionScaledDecodeJob<'_, '_>],
fmt: PixelFormat,
decode_options: DecodeOptions,
) -> Result<Vec<DecodeOutcome>, TileBatchError>
pub fn decode_tiles_region_scaled_into_with_options( &mut self, jobs: &mut [TileRegionScaledDecodeJob<'_, '_>], fmt: PixelFormat, decode_options: DecodeOptions, ) -> Result<Vec<DecodeOutcome>, TileBatchError>
Decode scaled JPEG tile regions with explicit JPEG decode options.
§Errors
Returns TileBatchError with the first codec failure in input order,
or a typed infrastructure failure when no tile index applies.
Trait Implementations§
Source§impl Debug for JpegBatchSession
impl Debug for JpegBatchSession
Auto Trait Implementations§
impl Freeze for JpegBatchSession
impl RefUnwindSafe for JpegBatchSession
impl Send for JpegBatchSession
impl Sync for JpegBatchSession
impl Unpin for JpegBatchSession
impl UnsafeUnpin for JpegBatchSession
impl UnwindSafe for JpegBatchSession
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