Type Definition libjxl_sys::JxlParallelRunInit[][src]

type JxlParallelRunInit = Option<unsafe extern "C" fn(jpegxl_opaque: *mut c_void, num_threads: usize) -> JxlParallelRetCode>;

Parallel run initialization callback. See JxlParallelRunner for details.

This function MUST be called by the JxlParallelRunner only once, on the same thread that called JxlParallelRunner, before any parallel execution. The purpose of this call is to provide the maximum number of threads that the JxlParallelRunner 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 JxlParallelRunner() 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 JxlParallelRunner().