| synopsis || return value || arguments || prev |
virtual bool set_precinct_scope( kdu_long unique_id)
Java: boolean Set_precinct_scope( long unique_id)
[Declared in "../coresys/common/kdu_compressed.h"]
This function must be implemented by sources which advertise support for the KDU_SOURCE_CAP_CACHED capability. It behaves somewhat like seek in repositioning the read pointer to an arbitrarily selected location, except that the location is specified by a unique identifier associated with the precinct, rather than an offset from the code-stream's SOC marker. Subsequent reads recover data from the packets of the identified precinct, in sequence, until no further data for the precinct exists.
Valid precinct identifiers are composed from three quantities: the zero-based tile index, T, identifying the tile to which the precinct belongs; the zero-based component index, C, indicating the image component to which the precinct belongs; and a zero-based sequence number, S, uniquely identifying the precinct within its tile-component. The identifier is then given by
where num_tiles is the number of tiles in the compressed image, as passed in any call to the set_tileheader_scope member function.
The sequence number, S, is based upon a fixed sequence, not affected by packet sequencing information in COD or POC marker segments. All precincts in resolution level 0 (the lowest resolution) appear first in this fixed sequence, starting from 0, followed immediately by all precincts in resolution level 1, and so forth. Within each resolution level, precincts are numbered in scan-line order, from top to bottom and left to right.
Although this numbering system may seem somewhat complicated, it has a number of desirable attributes: each precinct has a single unique address; lower resolution images or portions of images have relatively smaller identifiers; and there is no need for the compressed data source to know anything about the number of precincts in each tile-component-resolution.
Must return true if and only if the KDU_SOURCE_CAP_CACHED capability is supported, even if there is no data currently cached for the relevant precinct.
Unique identifier for the precinct which is to be accessed in future read calls. See above for a definition of this identifier. If the supplied value refers to a non-existent precinct, the source is at liberty to generate a terminal error, although it may simply treat such cases as precincts with no data, so that subsequent read calls would return 0.
| top || synopsis || return value || arguments || prev |