Function libjxl_sys::JxlEncoderAddImageFrame[][src]

pub unsafe extern "C" fn JxlEncoderAddImageFrame(
    options: *const JxlEncoderOptions,
    pixel_format: *const JxlPixelFormat,
    buffer: *const c_void,
    size: usize
) -> JxlEncoderStatus

Sets the buffer to read pixels from for the next image to encode. Must call JxlEncoderSetDimensions before JxlEncoderAddImageFrame.

Currently only some pixel formats are supported:

  • JXL_TYPE_UINT8
  • JXL_TYPE_UINT16
  • JXL_TYPE_FLOAT, with nominal range 0..1

The color profile of the pixels depends on the value of uses_original_profile in the JxlBasicInfo. If true, the pixels are assumed to be encoded in the original profile that is set with JxlEncoderSetColorEncoding or JxlEncoderSetICCProfile. If false, the pixels are assumed to be nonlinear sRGB for integer data types (JXL_TYPE_UINT8 and JXL_TYPE_UINT16), and linear sRGB for floating point data types (JXL_TYPE_FLOAT).

@param options set of encoder options to use when encoding the frame. @param pixel_format format for pixels. Object owned by the caller and its contents are copied internally. @param buffer buffer type to input the pixel data from. Owned by the caller and its contents are copied internally. @param size size of buffer in bytes. @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error