| synopsis || arguments || prev || next |

jp2_channels::set_colour_mapping

Java: Jp2_channels::Set_colour_mapping

void set_colour_mapping( int colour_idx, int codestream_component, int lut_idx=-1, int codestream_idx=0)

Java: void Set_colour_mapping( int colour_idx, int codestream_component, int lut_idx, int codestream_idx)

[Declared in "../apps/compressed_io/jp2.h"]

Go to class description.


Synopsis

This function is used, together with set_opacity_mapping and set_premult_mapping, to establish the relationship, if any, between code-stream image components and the reproduction functions of colour intensity, opacity and pre-multiplied opacity. The present function is most important, establishing the source of colour intensity information.

Each colour's intensity may be directly assigned to some code-stream image component. Alternatively, it may be associated with the output of a palette lookup table (LUT), together with a code-stream image component which provides indices into the LUT.

The colour_idx argument identifies the particular intensity channel whose mapping is being defined. A complete jp2_channels object must have an intensity mapping for each colour channel. However, the init function automatically installs a default mapping which directly associates the first num_colours code-stream components of code-stream 0 with the num_colours intensity channels. If this is what you want, there is no need to explicitly call the present function.


Arguments

colour_idx [int]

The meaning of this argument depends upon the colour space. Some common examples are:

codestream_component [int]

Identifies the image component (starting from 0) of the code-stream identified by codestream_idx which is used to create the relevant colour intensity channel, either by direct assignment or after mapping through a palette LUT.

lut_idx [int]

Set to -1 (the default) if the code-stream image component is to be assigned directly to the relevant colour intensity channel. Otherwise, the code-stream component samples are indices to a lookup table, where lut_idx gives the index of the lookup table (starting from 0), as it appears in the jp2_palette object.

codestream_idx [int]

Index of the code-stream whose components and palette lookup tables (if required) are used to generate this colour intensity channel. The meaning of the index for various file formats is as follows:


| top || synopsis || arguments || prev || next |