Skip to main content

JxlChunkedFrameInputSource

Struct JxlChunkedFrameInputSource 

Source
#[repr(C)]
pub struct JxlChunkedFrameInputSource { pub opaque: *mut c_void, pub get_color_channels_pixel_format: Option<unsafe extern "C" fn(opaque: *mut c_void, pixel_format: *mut JxlPixelFormat)>, pub get_color_channel_data_at: Option<unsafe extern "C" fn(opaque: *mut c_void, xpos: usize, ypos: usize, xsize: usize, ysize: usize, row_offset: *mut usize) -> *const c_void>, pub get_extra_channel_pixel_format: Option<unsafe extern "C" fn(opaque: *mut c_void, ec_index: usize, pixel_format: *mut JxlPixelFormat)>, pub get_extra_channel_data_at: Option<unsafe extern "C" fn(opaque: *mut c_void, ec_index: usize, xpos: usize, ypos: usize, xsize: usize, ysize: usize, row_offset: *mut usize) -> *const c_void>, pub release_buffer: Option<unsafe extern "C" fn(opaque: *mut c_void, buf: *const c_void)>, }
Expand description

This struct provides callback functions to pass pixel data in a streaming manner instead of requiring the entire frame data in memory at once.

Fields§

§opaque: *mut c_void

A pointer to any user-defined data or state. This can be used to pass information to the callback functions.

§get_color_channels_pixel_format: Option<unsafe extern "C" fn(opaque: *mut c_void, pixel_format: *mut JxlPixelFormat)>

Get the pixel format that color channel data will be provided in. When called, pixel_format points to a suggested pixel format; if color channel data can be given in this pixel format, processing might be more efficient.

This function will be called exactly once, before any call to get_color_channel_at.

@param opaque user supplied parameters to the callback @param pixel_format format for pixels

§get_color_channel_data_at: Option<unsafe extern "C" fn(opaque: *mut c_void, xpos: usize, ypos: usize, xsize: usize, ysize: usize, row_offset: *mut usize) -> *const c_void>

Callback to retrieve a rectangle of color channel data at a specific location. It is guaranteed that xpos and ypos are multiples of 8. xsize, ysize will be multiples of 8, unless the resulting rectangle would be out of image bounds. Moreover, xsize and ysize will be at most 2048. The returned data will be assumed to be in the format returned by the (preceding) call to get_color_channels_pixel_format, except the align parameter of the pixel format will be ignored. Instead, the i-th row will be assumed to start at position return_value + i * *row_offset, with the value of *row_offset decided by the callee.

Note that multiple calls to get_color_channel_data_at may happen before a call to release_buffer.

@param opaque user supplied parameters to the callback @param xpos horizontal position for the data. @param ypos vertical position for the data. @param xsize horizontal size of the requested rectangle of data. @param ysize vertical size of the requested rectangle of data. @param row_offset pointer to a the byte offset between consecutive rows of the retrieved pixel data. @return pointer to the retrieved pixel data.

§get_extra_channel_pixel_format: Option<unsafe extern "C" fn(opaque: *mut c_void, ec_index: usize, pixel_format: *mut JxlPixelFormat)>

Get the pixel format that extra channel data will be provided in. When called, pixel_format points to a suggested pixel format; if extra channel data can be given in this pixel format, processing might be more efficient.

This function will be called exactly once per index, before any call to get_extra_channel_data_at with that given index.

@param opaque user supplied parameters to the callback @param ec_index zero-indexed index of the extra channel @param pixel_format format for extra channel data

§get_extra_channel_data_at: Option<unsafe extern "C" fn(opaque: *mut c_void, ec_index: usize, xpos: usize, ypos: usize, xsize: usize, ysize: usize, row_offset: *mut usize) -> *const c_void>

Callback to retrieve a rectangle of extra channel ec_index data at a specific location. It is guaranteed that xpos and ypos are multiples of 8. xsize, ysize will be multiples of 8, unless the resulting rectangle would be out of image bounds. Moreover, xsize and ysize will be at most 2048. The returned data will be assumed to be in the format returned by the (preceding) call to get_extra_channels_pixel_format_at with the corresponding extra channel index ec_index, except the align parameter of the pixel format will be ignored. Instead, the i-th row will be assumed to start at position return_value + i * *row_offset, with the value of *row_offset decided by the callee.

Note that multiple calls to get_extra_channel_data_at may happen before a call to release_buffer.

@param opaque user supplied parameters to the callback @param xpos horizontal position for the data. @param ypos vertical position for the data. @param xsize horizontal size of the requested rectangle of data. @param ysize vertical size of the requested rectangle of data. @param row_offset pointer to a the byte offset between consecutive rows of the retrieved pixel data. @return pointer to the retrieved pixel data.

§release_buffer: Option<unsafe extern "C" fn(opaque: *mut c_void, buf: *const c_void)>

Releases the buffer buf (obtained through a call to get_color_channel_data_at or get_extra_channel_data_at). This function will be called exactly once per call to get_color_channel_data_at or get_extra_channel_data_at.

@param opaque user supplied parameters to the callback @param buf pointer returned by get_color_channel_data_at or get_extra_channel_data_at

Trait Implementations§

Source§

impl Clone for JxlChunkedFrameInputSource

Source§

fn clone(&self) -> JxlChunkedFrameInputSource

Returns a duplicate 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 JxlChunkedFrameInputSource

Source§

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

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

impl Default for JxlChunkedFrameInputSource

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for JxlChunkedFrameInputSource

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.