pub unsafe extern "C" fn JxlDecoderSetExtraChannelBuffer(
dec: *mut JxlDecoder,
format: *const JxlPixelFormat,
buffer: *mut c_void,
size: usize,
index: u32,
) -> JxlDecoderStatusExpand description
Sets the buffer to write an extra channel to. This can be set when
the ::JXL_DEC_FRAME or ::JXL_DEC_NEED_IMAGE_OUT_BUFFER event occurs,
and applies only for the current frame. The size of the buffer must be at
least as large as given by @ref JxlDecoderExtraChannelBufferSize. The buffer
follows the format described by @ref JxlPixelFormat, but where num_channels
is 1. The buffer is owned by the caller. The amount of extra channels is
given by the num_extra_channels field in the associated @ref JxlBasicInfo,
and the information of individual extra channels can be queried with @ref
JxlDecoderGetExtraChannelInfo. To get multiple extra channels, this function
must be called multiple times, once for each wanted index. Not all images
have extra channels. The alpha channel is an extra channel and can be gotten
as part of the color channels when using an RGBA pixel buffer with @ref
JxlDecoderSetImageOutBuffer, but additionally also can be gotten
separately as extra channel. The color channels themselves cannot be gotten
this way.
@param dec decoder object
@param format format of the pixels. Object owned by user and its contents
are copied internally. The num_channels value is ignored and is always
treated to be 1.
@param buffer buffer type to output the pixel data to
@param size size of buffer in bytes
@param index which extra channel to get, matching the index used in @ref
JxlDecoderGetExtraChannelInfo. Must be smaller than num_extra_channels in
the associated @ref JxlBasicInfo.
@return ::JXL_DEC_SUCCESS on success, ::JXL_DEC_ERROR on error, such as
size too small or invalid index.