pub struct JpegToHtj2kTranscoder { /* private fields */ }Expand description
Reusable experimental JPEG-to-HTJ2K transcoder state.
Create one value per worker thread and reuse it across many tiles to keep
scratch buffers allocated between calls. The scalar math and output are the
same as jpeg_to_htj2k.
Implementations§
Source§impl JpegToHtj2kTranscoder
impl JpegToHtj2kTranscoder
Sourcepub fn transcode(
&mut self,
bytes: &[u8],
options: &JpegToHtj2kOptions,
) -> Result<EncodedTranscode, JpegToHtj2kError>
pub fn transcode( &mut self, bytes: &[u8], options: &JpegToHtj2kOptions, ) -> Result<EncodedTranscode, JpegToHtj2kError>
Transcode a constrained baseline JPEG tile into HTJ2K using this instance’s reusable scratch buffers.
Sourcepub fn transcode_with_accelerator<A: DctToWaveletStageAccelerator>(
&mut self,
bytes: &[u8],
options: &JpegToHtj2kOptions,
accelerator: &mut A,
) -> Result<EncodedTranscode, JpegToHtj2kError>
pub fn transcode_with_accelerator<A: DctToWaveletStageAccelerator>( &mut self, bytes: &[u8], options: &JpegToHtj2kOptions, accelerator: &mut A, ) -> Result<EncodedTranscode, JpegToHtj2kError>
Transcode with an optional stage accelerator.
Accelerators may handle direct DCT-grid projection stages and return
None for scalar fallback. Integer-direct 5/3 is offered in
same-geometry batches before falling back to per-component work.
Sourcepub fn transcode_with_accelerators<A: DctToWaveletStageAccelerator, E: J2kEncodeStageAccelerator>(
&mut self,
bytes: &[u8],
options: &JpegToHtj2kOptions,
transform_accelerator: &mut A,
encode_accelerator: &mut E,
) -> Result<EncodedTranscode, JpegToHtj2kError>
pub fn transcode_with_accelerators<A: DctToWaveletStageAccelerator, E: J2kEncodeStageAccelerator>( &mut self, bytes: &[u8], options: &JpegToHtj2kOptions, transform_accelerator: &mut A, encode_accelerator: &mut E, ) -> Result<EncodedTranscode, JpegToHtj2kError>
Transcode with separate transform-stage and HTJ2K encode-stage accelerators.
Sourcepub fn transcode_batch(
&mut self,
tiles: &[JpegTileBatchInput<'_>],
options: &JpegToHtj2kOptions,
) -> Result<EncodedTranscodeBatch, JpegToHtj2kError>
pub fn transcode_batch( &mut self, tiles: &[JpegTileBatchInput<'_>], options: &JpegToHtj2kOptions, ) -> Result<EncodedTranscodeBatch, JpegToHtj2kError>
Transcode many JPEG tiles, preserving per-tile failures in the returned batch. Integer-direct 5/3 groups same-geometry components across tiles before calling the accelerator.
Sourcepub fn transcode_batch_with_accelerator<A: DctToWaveletStageAccelerator>(
&mut self,
tiles: &[JpegTileBatchInput<'_>],
options: &JpegToHtj2kOptions,
accelerator: &mut A,
) -> Result<EncodedTranscodeBatch, JpegToHtj2kError>
pub fn transcode_batch_with_accelerator<A: DctToWaveletStageAccelerator>( &mut self, tiles: &[JpegTileBatchInput<'_>], options: &JpegToHtj2kOptions, accelerator: &mut A, ) -> Result<EncodedTranscodeBatch, JpegToHtj2kError>
Transcode many JPEG tiles with an optional stage accelerator.
Sourcepub fn transcode_batch_with_accelerators<A: DctToWaveletStageAccelerator, E: J2kEncodeStageAccelerator>(
&mut self,
tiles: &[JpegTileBatchInput<'_>],
options: &JpegToHtj2kOptions,
transform_accelerator: &mut A,
encode_accelerator: &mut E,
) -> Result<EncodedTranscodeBatch, JpegToHtj2kError>
pub fn transcode_batch_with_accelerators<A: DctToWaveletStageAccelerator, E: J2kEncodeStageAccelerator>( &mut self, tiles: &[JpegTileBatchInput<'_>], options: &JpegToHtj2kOptions, transform_accelerator: &mut A, encode_accelerator: &mut E, ) -> Result<EncodedTranscodeBatch, JpegToHtj2kError>
Transcode many JPEG tiles with separate transform-stage and HTJ2K encode-stage accelerators.
Sourcepub fn dct_block_scratch_capacity(&self) -> usize
pub fn dct_block_scratch_capacity(&self) -> usize
Current capacity of the reusable DCT block conversion scratch.
This is exposed for benchmark and validation harnesses while the API is experimental.
Sourcepub fn integer_idct_block_scratch_capacity(&self) -> usize
pub fn integer_idct_block_scratch_capacity(&self) -> usize
Current capacity of the reusable integer block-local IDCT sample cache.
This cache stores level-shifted 8x8 block samples for the integer-direct path. It is block-local scratch, not a full spatial image plane.
Trait Implementations§
Source§impl Debug for JpegToHtj2kTranscoder
impl Debug for JpegToHtj2kTranscoder
Source§impl Default for JpegToHtj2kTranscoder
impl Default for JpegToHtj2kTranscoder
Source§fn default() -> JpegToHtj2kTranscoder
fn default() -> JpegToHtj2kTranscoder
Auto Trait Implementations§
impl Freeze for JpegToHtj2kTranscoder
impl RefUnwindSafe for JpegToHtj2kTranscoder
impl Send for JpegToHtj2kTranscoder
impl Sync for JpegToHtj2kTranscoder
impl Unpin for JpegToHtj2kTranscoder
impl UnsafeUnpin for JpegToHtj2kTranscoder
impl UnwindSafe for JpegToHtj2kTranscoder
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