Function openjpeg_sys::opj_set_decode_area

source ·
pub unsafe extern "C" fn opj_set_decode_area(
    p_codec: *mut opj_codec_t,
    p_image: *mut opj_image_t,
    p_start_x: OPJ_INT32,
    p_start_y: OPJ_INT32,
    p_end_x: OPJ_INT32,
    p_end_y: OPJ_INT32,
) -> OPJ_BOOL
Expand description

Sets the given area to be decoded. This function should be called right after opj_read_header and before any tile header reading.

The coordinates passed to this function should be expressed in the reference grid, that is to say at the highest resolution level, even if requesting the image at lower resolution levels.

Generally opj_set_decode_area() should be followed by opj_decode(), and the codec cannot be re-used. In the particular case of an image made of a single tile, several sequences of calls to opoj_set_decode_area() and opj_decode() are allowed, and will bring performance improvements when reading an image by chunks.

  • p_codec — the jpeg2000 codec.
  • p_image — the decoded image previously set by opj_read_header
  • p_start_x — the left position of the rectangle to decode (in image coordinates).
  • p_end_x — the right position of the rectangle to decode (in image coordinates).
  • p_start_y — the up position of the rectangle to decode (in image coordinates).
  • p_end_y — the bottom position of the rectangle to decode (in image coordinates).

@return true if the area could be set.