| synopsis || arguments || prev || next |
Overload navigation: 1, 2
void init( kdu_coords size, int num_components, bool unknown_space=true, int compression_type=JP2_COMPRESSION_TYPE_JPEG2000, int profile=2)
Java: void Init( Kdu_coords size, int num_components, boolean unknown_space, int compression_type, int profile)
[Declared in "../apps/compressed_io/jp2.h"]
Initializes the internal object, specifying the dimensions occupied by the image on the canvas and the number of image components. It is illegal to call this function unless there is an internal object ( exists must return true) and that object has not yet been initialized. To complete the initialization, precision information must be supplied for each image component (see below).
It is often more convenient to perform the configuration with a single call to the second form of this overloaded function, which uses the code-stream's siz_params object to recover all relevant information.
Holds the height and width of the image region on the canvas. Specifically, these are exactly the dimensions returned by kdu_codestream::get_dims when invoked with a negative comp_idx argument. Note, however, that the kdu_codestream::get_dims function also identifies the location of the image region on the canvas — an important property which is not recorded here. The limited dimensional information recoverable from the JP2 "Image Header" box is almost entirely useless, since it cannot be mapped to image component dimensions without considering sub-sampling factors and the precise location of the image region on the canvas. It may be useful in establishing the size of a scanned page when used in conjunction with explicit capture resolution information. It may also be useful for describing images which are not compressed at all (i.e., if compression_type is JP2_COMPRESSION_TYPE_NONE).
Number of image components. Although there will often be one image component for each colour channel, the number of image components can be either smaller than (see jp2_palette) or larger than (if some components are not used to represent colour channels) the number of colour channels.
True if the colour space information accessed via a jp2_colour object which uses this code-stream is not known to be correct. This is often the case in practice, where an sRGB space is often assumed in the absence of any specific knowledge concerning the primaries or gamma correction. It is not all that clear why this attribute is included in the "Image Header" box, but so be-it.
For JPEG2000 code-streams, use JP2_COMPRESSION_TYPE_JPEG2000. For a description of other values, see the description of the get_compression_type function.
This argument is ignored unless compression_type is equal to JP2_COMPRESSION_TYPE_JPEG2000. In that case, the following values are defined:
In the absence of any specific information, the safest bet is usually profile 2. The second form of the overloaded init function extracts this information from the code-stream parameter sub-system itself.