#[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_voidA 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
impl Clone for JxlChunkedFrameInputSource
Source§fn clone(&self) -> JxlChunkedFrameInputSource
fn clone(&self) -> JxlChunkedFrameInputSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more