Skip to main content

JpegBatchSession

Struct JpegBatchSession 

Source
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

Source

pub fn new(options: TileBatchOptions) -> Self

Create a session using the given CPU batch worker options.

Source

pub fn options(&self) -> TileBatchOptions

Return current worker options.

Source

pub fn set_options(&mut self, options: TileBatchOptions)

Replace worker options for future decode calls.

Source

pub fn reset(&mut self)

Clear worker-local decode contexts and scratch pools while retaining slots.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for JpegBatchSession

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.