| synopsis || return value || arguments || prev |
bool convert_rgb( kdu_line_buf & red, kdu_line_buf & green, kdu_line_buf & blue, int width=-1)
Java: boolean Convert_rgb( Kdu_line_buf red, Kdu_line_buf green, Kdu_line_buf blue, int width)
[Declared in "../apps/compressed_io/jp2.h"]
Implements any colour conversions required to obtain the standard JP2_sRGB_SPACE colour space from another 3 or 4 channel colour space. 4 channel colour spaces such as JP2_CMYK_SPACE or JP2_YCCK_SPACE are "converted" to an RGB rendition using only their first 3 colour channels. The function may be used only if the jp2_colour object passed to init describes at least 3 colour channels. If jp2_colour::get_space already returns JP2_sRGB_SPACE, this function may be called, but will do nothing.
All conversions are performed in-situ, overwriting the original contents of the red, green and blue buffers.
Although kdu_line_buf objects can represent sample values in four different ways, the present function requires the data to have a 16-bit normalized (fixed point) representation, with a nominal dynamic range of -0.5 to 0.5 (offsets will be added and later removed, as necessary, to create unsigned data for processing by tone reproduction curves). The least significant KDU_FIX_POINT bits of each 16-bit integer are the fraction bits of the fixed point representation. The selection of this representation is intended to facilitate interaction with the sample data processing operations conducted by the objects defined in "kdu_sample_processing.h" — see, for example, kdu_synthesis or kdu_decoder.
False if conversion is not possible. This happens only if the call to init returned false, or if init was never called.
Holds sample values for the first colour channel on input. Upon return, the values are overwritten with the colour corrected red data of the output sRGB space. Note that all samples have the signed, 16-bit fixed point representation with KDU_FIX_POINT fraction bits, as described above.
As for red, but holds the second colour channel on input and the sRGB green samples on output.
As for red, but holds the third colour channel on input and the sRGB blue samples on output.
If negative, the function processes all samples in the line buffers (they must all have the same length in this case, as reported by kdu_line_buf::get_width). Otherwise, only the first width samples of each line buffer are processed and the buffers may have different lengths so long as each has sufficient samples.
| top || synopsis || return value || arguments || prev |