pub struct MetalBatchDecoder { /* private fields */ }Expand description
Persistent Metal batch decoder.
The decoder retains one backend session across calls, including its Metal runtime, command queue, pipelines, lookup tables, scratch pools, and prepared direct-plan caches. Inputs queued in one call are grouped by the existing distinct/repeated HTJ2K batch scheduler.
Implementations§
Source§impl MetalBatchDecoder
impl MetalBatchDecoder
Sourcepub fn system_default() -> Result<Self, Error>
pub fn system_default() -> Result<Self, Error>
Create a persistent decoder using the system default Metal device.
Sourcepub fn system_default_with_options(
options: BatchDecodeOptions,
) -> Result<Self, Error>
pub fn system_default_with_options( options: BatchDecodeOptions, ) -> Result<Self, Error>
Create a persistent decoder with retained shared batch policy.
Sourcepub const fn options(&self) -> BatchDecodeOptions
pub const fn options(&self) -> BatchDecodeOptions
Shared preparation and output policy retained by this session.
Sourcepub fn submissions(&self) -> Result<u64, Error>
pub fn submissions(&self) -> Result<u64, Error>
Number of grouped codec submissions completed by the retained session.
Sourcepub fn prepare(&self, inputs: Vec<EncodedImage>) -> Result<PreparedBatch, Error>
pub fn prepare(&self, inputs: Vec<EncodedImage>) -> Result<PreparedBatch, Error>
Parse, validate, and group shared codec inputs for repeated Metal decode.
Sourcepub fn prepare_prepared_images(
&self,
images: Vec<PreparedImage>,
) -> Result<PreparedBatch, Error>
pub fn prepare_prepared_images( &self, images: Vec<PreparedImage>, ) -> Result<PreparedBatch, Error>
Regroup caller-supplied prepared images under this session’s retained settings and output policy without reparsing their encoded bytes.
Sourcepub fn decode_batch(
&mut self,
inputs: Vec<EncodedImage>,
) -> Result<MetalBatchDecodeResult, Error>
pub fn decode_batch( &mut self, inputs: Vec<EncodedImage>, ) -> Result<MetalBatchDecodeResult, Error>
Prepare and decode owned codec inputs into Metal-resident groups.
Sourcepub fn decode_prepared_images(
&mut self,
images: Vec<PreparedImage>,
) -> Result<MetalBatchDecodeResult, Error>
pub fn decode_prepared_images( &mut self, images: Vec<PreparedImage>, ) -> Result<MetalBatchDecodeResult, Error>
Regroup and decode caller-supplied prepared images without reparsing their encoded bytes.
Sourcepub fn decode_prepared(
&mut self,
prepared: &PreparedBatch,
) -> Result<MetalBatchDecodeResult, Error>
pub fn decode_prepared( &mut self, prepared: &PreparedBatch, ) -> Result<MetalBatchDecodeResult, Error>
Decode a reusable shared codec batch without consuming its inputs or plans.
Sourcepub fn decode_prepared_group(
&mut self,
group: &PreparedBatchGroup,
) -> Result<MetalBatchGroup, Error>
pub fn decode_prepared_group( &mut self, group: &PreparedBatchGroup, ) -> Result<MetalBatchGroup, Error>
Decode one homogeneous shared codec group using the preparation policy captured by the group.
Trait Implementations§
Source§impl BatchDecoder for MetalBatchDecoder
impl BatchDecoder for MetalBatchDecoder
Source§type Output = MetalBatchDecodeResult
type Output = MetalBatchDecodeResult
Source§fn options(&self) -> BatchDecodeOptions
fn options(&self) -> BatchDecodeOptions
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 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_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 MetalBatchDecoder
impl RefUnwindSafe for MetalBatchDecoder
impl Send for MetalBatchDecoder
impl Sync for MetalBatchDecoder
impl Unpin for MetalBatchDecoder
impl UnsafeUnpin for MetalBatchDecoder
impl UnwindSafe for MetalBatchDecoder
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