[][src]Type Definition jpegxl_sys::JpegxlParallelRunInit

type JpegxlParallelRunInit = Option<unsafe extern "C" fn(jpegxl_opaque: *mut c_void, num_threads: size_t) -> JpegxlParallelRetCode>;

Parallel run initialization callback. See JpegxlParallelRunner for details.

This function MUST be called by the JpegxlParallelRunner only once, on the same thread that called JpegxlParallelRunner, before any parallel execution. The purpose of this call is to provide the maximum number of threads that the JpegxlParallelRunner will use, which can be used by JPEG XL to allocate per-thread storage if needed.

@param jpegxl_opaque the @p jpegxl_opaque handle provided to JpegxlParallelRunner() must be passed here. @param num_threads the maximum number of threads. This value must be positive. @returns 0 if the initialization process was successful. @returns an error code if there was an error, which should be returned by JpegxlParallelRunner().