pub unsafe extern "C" fn JxlDecoderSetOutputColorProfile(
dec: *mut JxlDecoder,
color_encoding: *const JxlColorEncoding,
icc_data: *const u8,
icc_size: usize,
) -> JxlDecoderStatusExpand description
Sets the desired output color profile of the decoded image either from a
color encoding or an ICC profile. Valid calls of this function have either @c
color_encoding or @c icc_data set to NULL and @c icc_size must be 0 if and
only if @c icc_data is NULL.
Depending on whether a color management system (CMS) has been set the behavior is as follows:
If a color management system (CMS) has been set with @ref JxlDecoderSetCms, and the CMS supports output to the desired color encoding or ICC profile, then it will provide the output in that color encoding or ICC profile. If the desired color encoding or the ICC is not supported, then an error will be returned.
If no CMS has been set with @ref JxlDecoderSetCms, there are two cases:
(1) Calling this function with a color encoding will convert XYB images to the desired color encoding. In this case, if the requested color encoding has a narrower gamut, or the white points differ, then the resulting image can have significant color distortion. Non-XYB images will not be converted to the desired color space.
(2) Calling this function with an ICC profile will result in an error.
If called with an ICC profile (after a call to @ref JxlDecoderSetCms), the ICC profile has to be a valid RGB or grayscale color profile.
Can only be set after the ::JXL_DEC_COLOR_ENCODING event occurred and before any other event occurred, and should be used before getting ::JXL_COLOR_PROFILE_TARGET_DATA.
This function must not be called before @ref JxlDecoderSetCms.
@param dec decoder object @param color_encoding the output color encoding @param icc_data bytes of the icc profile @param icc_size size of the icc profile in bytes @return ::JXL_DEC_SUCCESS if the color profile was set successfully, @ref JXL_DEC_ERROR otherwise.