[][src]Function openjpeg2_sys::opj_codec_set_threads

pub unsafe extern "C" fn opj_codec_set_threads(
    p_codec: *mut opj_codec_t,
    num_threads: c_int
) -> OPJ_BOOL

Allocates worker threads for the compressor/decompressor.

By default, only the main thread is used. If this function is not used, but the OPJ_NUM_THREADS environment variable is set, its value will be used to initialize the number of threads. The value can be either an integer number, or "ALL_CPUS". If OPJ_NUM_THREADS is set and this function is called, this function will override the behaviour of the environment variable.

Currently this function must be called after opj_setup_decoder() and before opj_read_header().

Note: currently only has effect on the decompressor.

@param p_codec decompressor handler @param num_threads number of threads.

@return OPJ_TRUE if the decoder is correctly set