Loading...
Searching...
No Matches
JxlChunkedFrameInputSource Struct Reference
JPEG XL library (libjxl) » JPEG XL Encoder API

`#include <encode.h>`

## Public Attributes

void * | opaque
void(* | get_color_channels_pixel_format )(void *opaque, JxlPixelFormat *pixel_format)
const void *(* | get_color_channel_data_at )(void *opaque, size_t xpos, size_t ypos, size_t xsize, size_t ysize, size_t *row_offset)
void(* | get_extra_channel_pixel_format )(void *opaque, size_t ec_index, JxlPixelFormat *pixel_format)
const void *(* | get_extra_channel_data_at )(void *opaque, size_t ec_index, size_t xpos, size_t ypos, size_t xsize, size_t ysize, size_t *row_offset)
void(* | release_buffer )(void *opaque, const void *buf)

## Detailed 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.

## Member Data Documentation

## get_color_channel_data_at

const void *(* JxlChunkedFrameInputSource::get_color_channel_data_at) (void *opaque, size_t xpos, size_t ypos, size_t xsize, size_t ysize, size_t *row_offset)

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.

Parameters

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

Returns
  pointer to the retrieved pixel data.

## get_color_channels_pixel_format

void(* JxlChunkedFrameInputSource::get_color_channels_pixel_format) (void *opaque, JxlPixelFormat *pixel_format)

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.

Parameters

  opaque | user supplied parameters to the callback
  pixel_format | format for pixels

## get_extra_channel_data_at

const void *(* JxlChunkedFrameInputSource::get_extra_channel_data_at) (void *opaque, size_t ec_index, size_t xpos, size_t ypos, size_t xsize, size_t ysize, size_t *row_offset)

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

1. 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
2. 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.

Parameters

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

Returns
  pointer to the retrieved pixel data.

## get_extra_channel_pixel_format

void(* JxlChunkedFrameInputSource::get_extra_channel_pixel_format) (void *opaque, size_t ec_index, JxlPixelFormat *pixel_format)

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.

Parameters

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

## opaque

void* JxlChunkedFrameInputSource::opaque

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

## release_buffer

void(* JxlChunkedFrameInputSource::release_buffer) (void *opaque, const void *buf)

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.

Parameters

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

The documentation for this struct was generated from the following file:

- jxl/encode.h