opj_set_decoded_components

Function opj_set_decoded_components 

Source
pub unsafe extern "C" fn opj_set_decoded_components(
    p_codec: *mut opj_codec_t,
    numcomps: OPJ_UINT32,
    comps_indices: *const OPJ_UINT32,
    apply_color_transforms: OPJ_BOOL,
) -> OPJ_BOOL
Expand description

Restrict the number of components to decode. This function should be called after opj_read_header(). This function enables to restrict the set of decoded components to the specified indices. Note that the current implementation (apply_color_transforms == OPJ_FALSE) is such that neither the multi-component transform at codestream level, nor JP2 channel transformations will be applied. Consequently the indices are relative to the codestream. Note: opj_decode_tile_data() should not be used together with opj_set_decoded_components().

§Arguments

  • p_codec - the jpeg2000 codec to read.
  • numcomps - Size of the comps_indices array.
  • comps_indices - Array of numcomps values representing the indices of the components to decode (relative to the codestream, starting at 0)
  • apply_color_transforms - Whether multi-component transform at codestream level or JP2 channel transformations should be applied. Currently this parameter should be set to OPJ_FALSE. Setting it to OPJ_TRUE will result in an error.

§Returns

OPJ_TRUE in case of success.