#[repr(C)]
pub struct tjtransform { pub r: tjregion, pub op: c_int, pub options: c_int, pub data: *mut c_void, pub customFilter: Option<unsafe extern "C" fn(coeffs: *mut c_short, arrayRegion: tjregion, planeRegion: tjregion, componentID: c_int, transformID: c_int, transform: *mut tjtransform) -> c_int>, }
Expand description

Lossless transform

Fields§

§r: tjregion

Cropping region

§op: c_int

One of the @ref TJXOP “transform operations”

§options: c_int

The bitwise OR of one of more of the @ref TJXOPT_ARITHMETIC “transform options”

§data: *mut c_void

Arbitrary data that can be accessed within the body of the callback function

§customFilter: Option<unsafe extern "C" fn(coeffs: *mut c_short, arrayRegion: tjregion, planeRegion: tjregion, componentID: c_int, transformID: c_int, transform: *mut tjtransform) -> c_int>

A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG image. This allows for custom filters or other transformations to be applied in the frequency domain.

@param coeffs pointer to an array of transformed DCT coefficients. (NOTE: this pointer is not guaranteed to be valid once the callback returns, so applications wishing to hand off the DCT coefficients to another function or library should make a copy of them within the body of the callback.)

@param arrayRegion #tjregion structure containing the width and height of the array pointed to by coeffs as well as its offset relative to the component plane. TurboJPEG implementations may choose to split each component plane into multiple DCT coefficient arrays and call the callback function once for each array.

@param planeRegion #tjregion structure containing the width and height of the component plane to which coeffs belongs

@param componentID ID number of the component plane to which coeffs belongs. (Y, Cb, and Cr have, respectively, ID’s of 0, 1, and 2 in typical JPEG images.)

@param transformID ID number of the transformed image to which coeffs belongs. This is the same as the index of the transform in the transforms array that was passed to #tj3Transform().

@param transform a pointer to a #tjtransform structure that specifies the parameters and/or cropping region for this transform

@return 0 if the callback was successful, or -1 if an error occurred.

Trait Implementations§

source§

impl Clone for tjtransform

source§

fn clone(&self) -> tjtransform

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for tjtransform

source§

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

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

impl Copy for tjtransform

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.