Skip to main content

J2kDecoder

Struct J2kDecoder 

Source
pub struct J2kDecoder<'a> { /* private fields */ }
Expand description

CUDA-facing JPEG 2000 decoder wrapper.

Implementations§

Source§

impl<'a> J2kDecoder<'a>

Source

pub fn new(input: &'a [u8]) -> Result<Self, Error>

Create a CUDA-facing decoder from compressed bytes.

Source

pub fn decode_to_device_with_session( &mut self, fmt: PixelFormat, session: &mut CudaSession, ) -> Result<Surface, Error>

Strictly decode a full HTJ2K image into a CUDA-backed surface using an existing backend session.

Source

pub fn decode_batch_to_device_with_session( inputs: &[&[u8]], fmt: PixelFormat, session: &mut CudaSession, ) -> Result<Vec<Surface>, Error>

Strictly decode a batch of full HTJ2K images into CUDA-backed surfaces using an existing backend session.

Source

pub fn decode_to_host_surface( &mut self, fmt: PixelFormat, ) -> Result<Surface, Error>

Decode a full image through the CPU path and wrap it as a host surface.

Source

pub fn decode_to_cpu_staged_cuda_surface_with_session( &mut self, fmt: PixelFormat, session: &mut CudaSession, ) -> Result<Surface, Error>

Decode a full image on CPU and upload it into a CUDA buffer using an existing backend session.

Source

pub fn decode_region_to_cpu_staged_cuda_surface_with_session( &mut self, fmt: PixelFormat, roi: Rect, session: &mut CudaSession, ) -> Result<Surface, Error>

Decode a region on CPU and upload it into a CUDA buffer using an existing backend session.

Source

pub fn decode_scaled_to_cpu_staged_cuda_surface_with_session( &mut self, fmt: PixelFormat, scale: Downscale, session: &mut CudaSession, ) -> Result<Surface, Error>

Decode a scaled image on CPU and upload it into a CUDA buffer using an existing backend session.

Source

pub fn decode_region_scaled_to_cpu_staged_cuda_surface_with_session( &mut self, fmt: PixelFormat, roi: Rect, scale: Downscale, session: &mut CudaSession, ) -> Result<Surface, Error>

Decode a scaled region on CPU and upload it into a CUDA buffer using an existing backend session.

Auto Trait Implementations§

§

impl<'a> Freeze for J2kDecoder<'a>

§

impl<'a> RefUnwindSafe for J2kDecoder<'a>

§

impl<'a> Send for J2kDecoder<'a>

§

impl<'a> Sync for J2kDecoder<'a>

§

impl<'a> Unpin for J2kDecoder<'a>

§

impl<'a> UnsafeUnpin for J2kDecoder<'a>

§

impl<'a> UnwindSafe for J2kDecoder<'a>

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<'a, T> ImageDecode<'a> for T
where T: CpuBackedImageDecode<'a>, <<T as CpuBackedImageDecode<'a>>::Cpu as ImageCodec>::Error: Into<<T as ImageCodec>::Error>,

Source§

type View = <T as CpuBackedImageDecode<'a>>::View

Borrowed parse product that can later construct a decoder.
Source§

fn inspect(input: &'a [u8]) -> Result<Info, <T as ImageCodec>::Error>

Inspect metadata without decoding pixels. Read more
Source§

fn parse( input: &'a [u8], ) -> Result<<T as ImageDecode<'a>>::View, <T as ImageCodec>::Error>

Parse compressed bytes into a borrowed view. Read more
Source§

fn from_view( view: <T as ImageDecode<'a>>::View, ) -> Result<T, <T as ImageCodec>::Error>

Build a decoder from a parsed view. Read more
Source§

fn decode_into( &mut self, out: &mut [u8], stride: usize, fmt: PixelFormat, ) -> Result<DecodeOutcome<<T as ImageCodec>::Warning>, <T as ImageCodec>::Error>

Decode the full image into caller-owned output. Read more
Source§

fn decode_into_with_scratch( &mut self, pool: &mut <T as ImageCodec>::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, ) -> Result<DecodeOutcome<<T as ImageCodec>::Warning>, <T as ImageCodec>::Error>

Decode the full image into caller-owned output with reusable scratch. Read more
Source§

fn decode_region_into( &mut self, pool: &mut <T as ImageCodec>::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, roi: Rect, ) -> Result<DecodeOutcome<<T as ImageCodec>::Warning>, <T as ImageCodec>::Error>

Decode a source-coordinate region into caller-owned output. Read more
Source§

fn decode_scaled_into( &mut self, pool: &mut <T as ImageCodec>::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, scale: Downscale, ) -> Result<DecodeOutcome<<T as ImageCodec>::Warning>, <T as ImageCodec>::Error>

Decode the full image at reduced resolution into caller-owned output. Read more
Source§

fn decode_region_scaled_into( &mut self, pool: &mut <T as ImageCodec>::Pool, out: &mut [u8], stride: usize, fmt: PixelFormat, roi: Rect, scale: Downscale, ) -> Result<DecodeOutcome<<T as ImageCodec>::Warning>, <T as ImageCodec>::Error>

Decode a source-coordinate region at reduced resolution into caller-owned output. Read more
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.