pub unsafe extern "C" fn JxlEncoderSetExtraChannelBuffer(
    frame_settings: *const JxlEncoderFrameSettings,
    pixel_format: *const JxlPixelFormat,
    buffer: *const c_void,
    size: usize,
    index: u32
) -> JxlEncoderStatus
Expand description

Sets the buffer to read pixels from for an extra channel at a given index. The index must be smaller than the num_extra_channels in the associated JxlBasicInfo. Must call @ref JxlEncoderSetExtraChannelInfo before JxlEncoderSetExtraChannelBuffer.

TODO(firsching): mention what data types in pixel formats are supported.

It is required to call this function for every extra channel, except for the alpha channel if that was already set through @ref JxlEncoderAddImageFrame.

@param frame_settings set of options and metadata for this frame. Also includes reference to the encoder object. @param pixel_format format for pixels. Object owned by the caller and its contents are copied internally. The num_channels value is ignored, since the number of channels for an extra channel is always assumed to be one. @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. This size should match what is implied by the frame dimensions and the pixel format. @param index index of the extra channel to use. @return JXL_ENC_SUCCESS on success, JXL_ENC_ERROR on error