The codestream animation header, optionally present in the beginning of
the codestream, and if it is it applies to all animation frames, unlike @ref
JxlFrameHeader which applies to an individual frame.
The information about blending the color channels or a single extra channel.
When decoding, if coalescing is enabled (default), this can be ignored and
the blend mode is considered to be JXL_BLEND_REPLACE.
When encoding, these settings apply to the pixel data given to the encoder.
Interface for performing colorspace transforms. The @c init function can be
called several times to instantiate several transforms, including before
other transforms have been destroyed.
The @ref JxlEncoderOutputProcessor structure provides an interface for the
encoder’s output processing. Users of the library, who want to do streaming
encoding, should implement the required callbacks for buffering, writing,
seeking (if supported), and setting a finalized position during the encoding
process.
The information about layers.
When decoding, if coalescing is enabled (default), this can be ignored.
When encoding, these settings apply to the pixel data given to the encoder,
the encoder could choose an internal representation that differs.
Data type for the sample values per channel per pixel for the output buffer
for pixels. This is not necessarily the same as the data type encoded in the
codestream. The channels are interleaved per pixel. The pixels are
organized row by row, left to right, top to bottom.
TODO(lode): support different channel orders if needed (RGB, BGR, …)
Defines which color profile to get: the profile from the codestream
metadata header, which represents the color profile of the original image,
or the color profile from the pixel data produced by the decoder. Both are
the same if the JxlBasicInfo has uses_original_profile set.
Return value for @ref JxlDecoderProcessInput.
The values from ::JXL_DEC_BASIC_INFO onwards are optional informative
events that can be subscribed to, they are never returned if they
have not been registered with @ref JxlDecoderSubscribeEvents.
Id of encoder options for a frame. This includes options such as setting
encoding effort/speed or overriding the use of certain coding tools, for this
frame. This does not include non-frame related encoder options such as for
boxes.
Image orientation metadata.
Values 1..8 match the EXIF definitions.
The name indicates the operation to perform to transform from the encoded
image to the display image.
Built-in primaries for color encoding. When decoding, the primaries can be
read from the @ref JxlColorEncoding primaries_red_xy, primaries_green_xy and
primaries_blue_xy fields regardless of the enum value. When encoding, the
enum values except ::JXL_PRIMARIES_CUSTOM override the numerical fields.
Some enum values match a subset of CICP (Rec. ITU-T H.273 | ISO/IEC
23091-2:2019(E)), however the white point and RGB primaries are separate
enums here.
Types of progressive detail.
Setting a progressive detail with value N implies all progressive details
with smaller or equal value. Currently only the following level of
progressive detail is implemented:
Built-in transfer functions for color encoding. Enum values match a subset
of CICP (Rec. ITU-T H.273 | ISO/IEC 23091-2:2019(E)) unless specified
otherwise.
Built-in white points for color encoding. When decoding, the numerical xy
white point value can be read from the @ref JxlColorEncoding white_point
field regardless of the enum value. When encoding, enum values except
::JXL_WHITE_POINT_CUSTOM override the numerical fields. Some enum values
match a subset of CICP (Rec. ITU-T H.273 | ISO/IEC 23091-2:2019(E)), however
the white point and RGB primaries are separate enums here.
Marks the input as finished, indicates that no more @ref JxlDecoderSetInput
will be called. This function allows the decoder to determine correctly if it
should return success, need more input or error in certain cases. For
backwards compatibility with a previous version of the API, using this
function is optional when not using the ::JXL_DEC_BOX event (the decoder
is able to determine the end of the image frames without marking the end),
but using this function is required when using ::JXL_DEC_BOX for getting
metadata box contents. This function does not replace @ref
JxlDecoderReleaseInput, that function should still be called if its return
value is needed.
Returns the minimum size in bytes of an extra channel pixel buffer for the
given format. This is the buffer for @ref JxlDecoderSetExtraChannelBuffer.
Requires the basic image information is available in the decoder.
Outputs progressive step towards the decoded image so far when only partial
input was received. If the flush was successful, the buffer set with @ref
JxlDecoderSetImageOutBuffer will contain partial image data.
Returns the size of the contents of a box, after the @ref
JXL_DEC_BOX event. This does not include any of the headers of the box. For
compressed “brob” boxes, this is the size of the compressed content. Even
when @ref JxlDecoderSetDecompressBoxes is enabled, the return value of
function does not change, and the decompressed size is not known before it
has already been decompressed and output.
Outputs the type of the current box, after a ::JXL_DEC_BOX event occurred,
as 4 characters without null termination character. In case of a compressed
“brob” box, this will return “brob” if the decompressed argument is
JXL_FALSE, or the underlying box type if the decompressed argument is
JXL_TRUE.
Outputs the color profile as JPEG XL encoded structured data, if available.
This is an alternative to an ICC Profile, which can represent a more limited
amount of color spaces, but represents them exactly through enum values.
Outputs ICC profile if available. The profile is only available if @ref
JxlDecoderGetICCProfileSize returns success. The output buffer must have
at least as many bytes as given by @ref JxlDecoderGetICCProfileSize.
Outputs the blend information for the current frame for a specific extra
channel. This function can be called once the ::JXL_DEC_FRAME event occurred
for the current frame, even if the have_animation field in the @ref
JxlBasicInfo is @ref JXL_FALSE. This information is only useful if coalescing
is disabled; otherwise the decoder will have performed blending already.
Outputs name for extra channel at the given index in UTF-8. The index must be
smaller than num_extra_channels in the associated @ref JxlBasicInfo. The
buffer for name must have at least name_length + 1 bytes allocated, gotten
from the associated @ref JxlExtraChannelInfo.
Outputs the information from the frame, such as duration when have_animation.
This function can be called when ::JXL_DEC_FRAME occurred for the current
frame, even when have_animation in the JxlBasicInfo is JXL_FALSE.
Outputs the size in bytes of the ICC profile returned by @ref
JxlDecoderGetColorAsICCProfile, if available, or indicates there is none
available. In most cases, the image will have an ICC profile available, but
if it does not, @ref JxlDecoderGetColorAsEncodedProfile must be used instead.
Returns the intended downsampling ratio for the progressive frame produced
by @ref JxlDecoderFlushImage after the latest ::JXL_DEC_FRAME_PROGRESSION
event.
Returns the minimum size in bytes of the image output pixel buffer for the
given format. This is the buffer for @ref JxlDecoderSetImageOutBuffer.
Requires that the basic image information is available in the decoder in the
case of coalescing enabled (default). In case coalescing is disabled, this
can only be called after the ::JXL_DEC_FRAME event occurs. In that case,
it will return the size required to store the possibly cropped frame (which
can be larger or smaller than the image dimensions).
Returns the minimum size in bytes of the preview image output pixel buffer
for the given format. This is the buffer for @ref
JxlDecoderSetPreviewOutBuffer. Requires the preview header information is
available in the decoder.
Decodes JPEG XL file using the available bytes. Requires input has been
set with @ref JxlDecoderSetInput. After @ref JxlDecoderProcessInput, input
can optionally be released with @ref JxlDecoderReleaseInput and then set
again to next bytes in the stream. @ref JxlDecoderReleaseInput returns how
many bytes are not yet processed, before a next call to @ref
JxlDecoderProcessInput all unprocessed bytes must be provided again (the
address need not match, but the contents must), and more bytes may be
concatenated after the unprocessed bytes.
Releases input which was provided with @ref JxlDecoderSetInput. Between @ref
JxlDecoderProcessInput and @ref JxlDecoderReleaseInput, the user may not
alter the data in the buffer. Calling @ref JxlDecoderReleaseInput is required
whenever any input is already set and new input needs to be added with @ref
JxlDecoderSetInput, but is not required before @ref JxlDecoderDestroy or @ref
JxlDecoderReset. Calling @ref JxlDecoderReleaseInput when no input is set is
not an error and returns 0.
Re-initializes a @ref JxlDecoder instance, so it can be re-used for decoding
another image. All state and settings are reset as if the object was
newly created with @ref JxlDecoderCreate, but the memory manager is kept.
Rewinds decoder to the beginning. The same input must be given again from
the beginning of the file and the decoder will emit events from the beginning
again. When rewinding (as opposed to @ref JxlDecoderReset), the decoder can
keep state about the image, which it can use to skip to a requested frame
more efficiently with @ref JxlDecoderSkipFrames. Settings such as parallel
runner or subscribed events are kept. After rewind, @ref
JxlDecoderSubscribeEvents can be used again, and it is feasible to leave out
events that were already handled before, such as ::JXL_DEC_BASIC_INFO
and ::JXL_DEC_COLOR_ENCODING, since they will provide the same information
as before.
The difference to @ref JxlDecoderReset is that some state is kept, namely
settings set by a call to
Sets the color management system (CMS) that will be used for color
conversion (if applicable) during decoding. May only be set before starting
decoding and must not be called after @ref JxlDecoderSetOutputColorProfile.
Enables or disables coalescing of zero-duration frames. By default, frames
are returned with coalescing enabled, i.e. all frames have the image
dimensions, and are blended if needed. When coalescing is disabled, frames
can have arbitrary dimensions, a non-zero crop offset, and blending is not
performed. For display, coalescing is recommended. For loading a multi-layer
still image as separate layers (as opposed to the merged image), coalescing
has to be disabled.
Configures whether to get boxes in raw mode or in decompressed mode. In raw
mode, boxes are output as their bytes appear in the container file, which may
be decompressed, or compressed if their type is “brob”. In decompressed mode,
“brob” boxes are decompressed with Brotli before outputting them. The size of
the decompressed stream is not known before the decompression has already
finished.
Requests that the decoder perform tone mapping to the peak display luminance
passed as @c desired_intensity_target, if appropriate.
@note This is provided for convenience and the exact tone mapping that is
performed is not meant to be considered authoritative in any way. It may
change from version to version.
@param dec decoder object
@param desired_intensity_target the intended target peak luminance
@return ::JXL_DEC_SUCCESS if the preference was set successfully, @ref
JXL_DEC_ERROR otherwise.
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.
Sets the buffer to write the full resolution image to. This can be set when
the ::JXL_DEC_FRAME event occurs, must be set when the @ref
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 JxlDecoderImageOutBufferSize. The buffer follows the format described
by @ref JxlPixelFormat. The buffer is owned by the caller.
Sets pixel output callback. This is an alternative to @ref
JxlDecoderSetImageOutBuffer. This can be set when the ::JXL_DEC_FRAME
event occurs, must be set when the ::JXL_DEC_NEED_IMAGE_OUT_BUFFER event
occurs, and applies only for the current frame. Only one of @ref
JxlDecoderSetImageOutBuffer or @ref JxlDecoderSetImageOutCallback may be used
for the same frame, not both at the same time.
Sets input data for @ref JxlDecoderProcessInput. The data is owned by the
caller and may be used by the decoder until @ref JxlDecoderReleaseInput is
called or the decoder is destroyed or reset so must be kept alive until then.
Cannot be called if @ref JxlDecoderSetInput was already called and @ref
JxlDecoderReleaseInput was not yet called, and cannot be called after @ref
JxlDecoderCloseInput indicating the end of input was called.
Enables or disables preserving of as-in-bitstream pixeldata
orientation. Some images are encoded with an Orientation tag
indicating that the decoder must perform a rotation and/or
mirroring to the encoded image data.
Similar to @ref JxlDecoderSetImageOutCallback except that the callback is
allowed an initialization phase during which it is informed of how many
threads will call it concurrently, and those calls are further informed of
which thread they are occurring in.
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.
Sets the desired output color profile of the decoded image by calling
@ref JxlDecoderSetOutputColorProfile, passing on @c color_encoding and
setting @c icc_data to NULL. See @ref JxlDecoderSetOutputColorProfile for
details.
Sets the buffer to write the low-resolution preview image
to. The size of the buffer must be at least as large as given by @ref
JxlDecoderPreviewOutBufferSize. The buffer follows the format described
by @ref JxlPixelFormat. The preview image dimensions are given by the
@ref JxlPreviewHeader. The buffer is owned by the caller.
Configures at which progressive steps in frame decoding these @ref
JXL_DEC_FRAME_PROGRESSION event occurs. The default value for the level
of detail if this function is never called is kDC.
Enables or disables rendering spot colors. By default, spot colors
are rendered, which is OK for viewing the decoded image. If render_spotcolors
is ::JXL_FALSE, then spot colors are not rendered, and have to be
retrieved separately using @ref JxlDecoderSetExtraChannelBuffer. This is
useful for e.g. printing applications.
Enables or disables preserving of associated alpha channels. If
unpremul_alpha is set to ::JXL_FALSE then for associated alpha channel,
the pixel data is returned with premultiplied colors. If it is set to @ref
JXL_TRUE, The colors will be unpremultiplied based on the alpha channel. This
function has no effect if the image does not have an associated alpha
channel.
Returns a hint indicating how many more bytes the decoder is expected to
need to make @ref JxlDecoderGetBasicInfo available after the next @ref
JxlDecoderProcessInput call. This is a suggested large enough value for
the amount of bytes to provide in the next @ref JxlDecoderSetInput call, but
it is not guaranteed to be an upper bound nor a lower bound. This number does
not include bytes that have already been released from the input. Can be used
before the first @ref JxlDecoderProcessInput call, and is correct the first
time in most cases. If not, @ref JxlDecoderSizeHintBasicInfo can be called
again to get an updated hint.
Skips processing the current frame. Can be called after frame processing
already started, signaled by a ::JXL_DEC_NEED_IMAGE_OUT_BUFFER event,
but before the corresponding ::JXL_DEC_FULL_IMAGE event. The next signaled
event will be another ::JXL_DEC_FRAME, or ::JXL_DEC_SUCCESS if there
are no more frames. If pixel data is required from the already processed part
of the frame, @ref JxlDecoderFlushImage must be called before this.
Makes the decoder skip the next amount frames. It still needs to process
the input, but will not output the frame events. It can be more efficient
when skipping frames, and even more so when using this after @ref
JxlDecoderRewind. If the decoder is already processing a frame (could
have emitted ::JXL_DEC_FRAME but not yet ::JXL_DEC_FULL_IMAGE), it
starts skipping from the next frame. If the amount is larger than the amount
of frames remaining in the image, all remaining frames are skipped. Calling
this function multiple times adds the amount to skip to the already existing
amount.
Select for which informative events, i.e. ::JXL_DEC_BASIC_INFO, etc., the
decoder should return with a status. It is not required to subscribe to any
events, data can still be requested from the decoder as soon as it available.
By default, the decoder is subscribed to no events (events_wanted == 0), and
the decoder will then only return when it cannot continue because it needs
more input data or more output buffer. This function may only be be called
before using @ref JxlDecoderProcessInput.
Adds a metadata box to the file format. @ref JxlEncoderProcessOutput must be
used to effectively write the box to the output. @ref JxlEncoderUseBoxes must
be enabled before using this function.
Declares that no further boxes will be added with @ref JxlEncoderAddBox.
This function must be called after the last box is added so the encoder knows
the stream will be finished. It is not necessary to use this function if
@ref JxlEncoderUseBoxes is not used. Further frames may still be added.
Declares that no frames will be added and @ref JxlEncoderAddImageFrame and
@ref JxlEncoderAddJPEGFrame won’t be called anymore. Further metadata boxes
may still be added. This function or @ref JxlEncoderCloseInput must be called
after adding the last frame and the next call to
@ref JxlEncoderProcessOutput, or the frame won’t be properly marked as last.
Closes any input to the encoder, equivalent to calling @ref
JxlEncoderCloseFrames as well as calling @ref JxlEncoderCloseBoxes if needed.
No further input of any kind may be given to the encoder, but further @ref
JxlEncoderProcessOutput calls should be done to create the final output.
Returns the codestream level required to support the currently configured
settings and basic info. This function can only be used at the beginning,
before encoding starts, but after setting basic info.
Initializes a @ref JxlBasicInfo struct to default values.
For forwards-compatibility, this function has to be called before values
are assigned to the struct fields.
The default values correspond to an 8-bit RGB image, no alpha or any
other extra channels.
Initializes a @ref JxlBlendInfo struct to default values.
For forwards-compatibility, this function has to be called before values
are assigned to the struct fields.
Initializes a @ref JxlExtraChannelInfo struct to default values.
For forwards-compatibility, this function has to be called before values
are assigned to the struct fields.
The default values correspond to an 8-bit channel of the provided type.
Initializes a @ref JxlFrameHeader struct to default values.
For forwards-compatibility, this function has to be called before values
are assigned to the struct fields.
The default values correspond to a frame with no animation duration and the
‘replace’ blend mode. After using this function, For animation duration must
be set, for composite still blend settings must be set.
Encodes a JPEG XL file using the available bytes. @p *avail_out indicates how
many output bytes are available, and @p *next_out points to the input bytes.
*avail_out will be decremented by the amount of bytes that have been
processed by the encoder and *next_out will be incremented by the same
amount, so *next_out will now point at the amount of *avail_out unprocessed
bytes.
Re-initializes a @ref JxlEncoder instance, so it can be re-used for encoding
another image. All state and settings are reset as if the object was
newly created with @ref JxlEncoderCreate, but the memory manager is kept.
Sets the color management system (CMS) that will be used for color conversion
(if applicable) during encoding. May only be set before starting encoding. If
left unset, the default CMS implementation will be used.
Sets the feature level of the JPEG XL codestream. Valid values are 5 and
10, or -1 (to choose automatically). Using the minimum required level, or
level 5 in most cases, is recommended for compatibility with all decoders.
Sets the original color encoding of the image encoded by this encoder. This
is an alternative to @ref JxlEncoderSetICCProfile and only one of these two
must be used. This one sets the color encoding as a @ref JxlColorEncoding,
while the other sets it as ICC binary data. Must be called after @ref
JxlEncoderSetBasicInfo.
Sets blend info of an extra channel. The blend info of extra channels is set
separately from that of the color channels, the color channels are set with
@ref JxlEncoderSetFrameHeader.
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
@ref JxlBasicInfo. Must call @ref JxlEncoderSetExtraChannelInfo before @ref
JxlEncoderSetExtraChannelBuffer.
Sets the distance level for lossy compression of extra channels.
The distance is as in @ref JxlEncoderSetFrameDistance (lower = higher
quality). If not set, or if set to the special value -1, the distance that
was set with
@ref JxlEncoderSetFrameDistance will be used.
Sets the name for the extra channel at the given index in UTF-8. The index
must be smaller than the num_extra_channels in the associated @ref
JxlBasicInfo.
Sets the distance level for lossy compression: target max butteraugli
distance, lower = higher quality. Range: 0 .. 25.
0.0 = mathematically lossless (however, use @ref JxlEncoderSetFrameLossless
instead to use true lossless, as setting distance to 0 alone is not the only
requirement). 1.0 = visually lossless. Recommended range: 0.5 .. 3.0. Default
value: 1.0.
Sets the frame information for this frame to the encoder. This includes
animation information such as frame duration to store in the frame header.
The frame header fields represent the frame as passed to the encoder, but not
necessarily the exact values as they will be encoded file format: the encoder
could change crop and blending options of a frame for more efficient encoding
or introduce additional internal frames. Animation duration and time code
information is not altered since those are immutable metadata of the frame.
Sets the name of the animation frame. This function is optional, frames are
not required to have a name. This setting is a part of the frame header, and
the same principles as for @ref JxlEncoderSetFrameHeader apply. The
name_length field of @ref JxlFrameHeader is ignored by the encoder, this
function determines the name length instead as the length in bytes of the C
string.
Sets the original color encoding of the image encoded by this encoder as an
ICC color profile. This is an alternative to @ref JxlEncoderSetColorEncoding
and only one of these two must be used. This one sets the color encoding as
ICC binary data, while the other defines it as a @ref JxlColorEncoding. Must
be called after @ref JxlEncoderSetBasicInfo.
Sets the output processor for the encoder. This processor determines how the
encoder will handle buffering, writing, seeking (if supported), and
setting a finalized position during the encoding process.
Sets the upsampling method the decoder will use in case there are frames
with ::JXL_ENC_FRAME_SETTING_RESAMPLING set. This is useful in combination
with the ::JXL_ENC_FRAME_SETTING_ALREADY_DOWNSAMPLED option, to control
the type of upsampling that will be used.
Indicates the intention to add metadata boxes. This allows @ref
JxlEncoderAddBox to be used. When using this function, then it is required
to use @ref JxlEncoderCloseBoxes at the end.
Calculates the total size required to serialize the gain map bundle into a
binary buffer. This function accounts for all the necessary space to
serialize fields such as gain map metadata, color encoding, compressed ICC
profile data, and the gain map itself.
Deserializes a gain map bundle from a provided buffer and populates a
JxlGainMapBundle structure with the data extracted. This function assumes
the buffer contains a valid serialized gain map bundle. After successful
execution, the JxlGainMapBundle structure will reference three different
sections within the buffer:
Serializes the gain map bundle into a preallocated buffer. The function
ensures that all parts of the bundle such as metadata, color encoding,
compressed ICC profile, and the gain map are correctly encoded into the
buffer. First call JxlGainMapGetBundleSize to get the size needed for
the buffer.
Allocates a buffer using the memory manager, fills it with the decompressed
version of the ICC profile in @c compressed_icc, returns the result through
@c output_buffer and indicates its size through @c output_size.
Allocates a buffer using the memory manager, fills it with a compressed
representation of an ICC profile, returns the result through @c output_buffer
and indicates its size through @c output_size.
Creates the runner for @ref JxlResizableParallelRunner. Use as the opaque
runner. The runner will execute tasks on the calling thread until
@ref JxlResizableParallelRunnerSetThreads is called.
Destruction callback for @ref JxlDecoderSetMultithreadedImageOutCallback,
called after all invocations of the @c run callback to perform any
appropriate clean-up of the @c run_opaque data returned by @c init.
Return code used in the JxlParallel* functions as return value. A value
of ::JXL_PARALLEL_RET_SUCCESS means success and any other value means error.
The special value ::JXL_PARALLEL_RET_RUNNER_ERROR can be used by the runner
to indicate any other error.
JxlParallelRunner function type. A parallel runner implementation can be
provided by a JPEG XL caller to allow running computations in multiple
threads. This function must call the initialization function @p init in the
same thread that called it and then call the passed @p func once for every
number in the range [start_range, end_range) (including start_range but not
including end_range) possibly from different multiple threads in parallel.
Returns a buffer that can be used by callers of the interface to store the
input of the conversion or read its result, if they pass it as the input or
output of the @c run function.
@param user_data the data returned by @c init.
@param thread the index of the thread for which to return a buffer.
@return A buffer that can be used by the caller for passing to @c run.
Allocates and returns the data needed for @p num_threads parallel transforms
from the @p input colorspace to @p output, with up to @p pixels_per_thread
pixels to transform per call to @ref JxlCmsInterface::run. @p init_data comes
directly from the @ref JxlCmsInterface instance. Since @c run only receives
the data returned by @c init, a reference to @p init_data should be kept
there if access to it is desired in @c run. Likewise for @ref
JxlCmsInterface::destroy.
Executes one transform and returns true on success or false on error. It
must be possible to call this from different threads with different values
for @p thread, all between 0 (inclusive) and the value of @p num_threads
passed to @c init (exclusive). It is allowed to implement this by locking
such that the transforms are essentially performed sequentially, if such a
performance profile is acceptable. @p user_data is the data returned by
@c init.
The buffers each contain @p num_pixels × @c num_channels interleaved floating
point (0..1) samples where @c num_channels is the number of color channels of
their respective color profiles. It is guaranteed that the only case in which
they might overlap is if the output has fewer channels than the input, in
which case the pointers may be identical.
For CMYK data, 0 represents the maximum amount of ink while 1 represents no
ink.
@param user_data the data returned by @c init.
@param thread the index of the thread from which the function is being
called.
@param input_buffer the buffer containing the pixel data to be transformed.
@param output_buffer the buffer receiving the transformed pixel data.
@param num_pixels the number of pixels to transform from @p input to
@p output.
@return ::JXL_TRUE on success, ::JXL_FALSE on failure.