pub unsafe extern "C-unwind" 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 JxlDecoderStatus::Frame or JxlDecoderStatus::NeedImageOutBuffer event occurs,
and applies only for the current frame. The size of the buffer must be at
least as large as given by JxlDecoderExtraChannelBufferSize. The buffer
follows the format described by 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 JxlBasicInfo,
and the information of individual extra channels can be queried with 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 JxlDecoderSetImageOutBuffer,
but additionally also can be gotten separately as extra channel. The color channels themselves cannot be gotten
this way.
§Parameters
dec: decoder objectformat: format of the pixels. Object owned by user and its contents are copied internally. Thenum_channelsvalue is ignored and is always treated to be1.buffer: buffer type to output the pixel data tosize: size of buffer in bytesindex: which extra channel to get, matching the index used inJxlDecoderGetExtraChannelInfo. Must be smaller thannum_extra_channelsin the associatedJxlBasicInfo.
§Returns
JxlDecoderStatus::Successon success,JxlDecoderStatus::Erroron error, such as size too small or invalid index.