Skip to main content

JpegToHtj2kTranscoder

Struct JpegToHtj2kTranscoder 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

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

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

impl Default for JpegToHtj2kTranscoder

Source§

fn default() -> JpegToHtj2kTranscoder

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, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.