

Performs the necessary clean-up and frees the memory allocated for user data. typedef void ( * jpegxl_cms_destroy_func ) ( void * )

JXL_TRUE on success, JXL_FALSE on failure. The number of pixels to transform from input to output. The buffer receiving the transformed pixel data. The buffer containing the pixel data to be transformed. The index of the thread from which the function is being called. For CMYK data, 0 represents the maximum amount of ink while 1 represents no ink. 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. The buffers each contain num_pixels × num_channels interleaved floating point (0.1) samples where num_channels is the number of color channels of their respective color profiles. It is allowed to implement this by locking such that the transforms are essentially performed sequentially, if such a performance profile is acceptable. It must be possible to call this from different threads with different values for thread, all between 0 (inclusive) and the value of num_threads passed to init (exclusive). typedef JXL_BOOL ( * jpegxl_cms_run_func ) ( void * user_data, size_t thread, const float * input_buffer, float * output_buffer, size_t num_pixels ) Įxecutes one transform and returns true on success or false on error. ReturnĪ buffer that can be used by the caller for passing to run. The index of the thread for which to return a buffer. 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 run function. typedef float * ( * jpegxl_cms_get_buffer_func ) ( void * user_data, size_t thread ) This will be passed to the other functions as user_data. The data needed for the transform, or NULL in case of failure. The OOTF is a gamma function applied to the luminance channel ( page 7), with the gamma value computed as 1.2 * 1.111^log2(intensity_target / 1000) (footnote 2 page 8 of the same document). That is, conversions from HLG should apply the OOTF for a peak display luminance of intensity_target, and conversions to HLG should undo it.

It is also used for conversions to and from HLG, as it is scene-referred while other colorspaces are assumed to be display-referred. This is useful for conversions between PQ and a relative luminance colorspace, in either direction: intensity_targetĬd/m² in PQ should map to and from (1, 1, 1) in the relative one. Param intensity_targetįor colorspaces where luminance is relative (essentially: not PQ), indicates the luminance at which (1, 1, 1) will be displayed. The colorspace to which JxlCmsInterface::run should convert the input data. The maximum number of pixels that each call to JxlCmsInterface::run will have to transform. The maximum number of threads from which JxlCmsInterface::run will be called.

The ICC data in input and output is guaranteed to outlive the init / run / destroy cycle. Since run only receives the data returned by init, a reference to init_data should be kept there if access to it is desired in run. init_data comes directly from the JxlCmsInterface instance. Import java.io.File import jxl.Workbook import import import import typedef void * ( * jpegxl_cms_init_func ) ( void * init_data, size_t num_threads, size_t pixels_per_thread, const JxlColorProfile * input_profile, const JxlColorProfile * output_profile, float intensity_target ) Īllocates and returns the data needed for num_threads parallel transforms from the input colorspace to output, with up to pixels_per_thread pixels to transform per call to JxlCmsInterface::run.
