| synopsis || return value || arguments || prev || next |
bool convert_lum( kdu_line_buf & line, int width=-1)
Java: boolean Convert_lum( Kdu_line_buf line, int width)
[Declared in "../apps/compressed_io/jp2.h"]
Implements any linear or non-linear mapping required to obtain standard JP2_sLUM_SPACE samples from a single channel colour description. The function may be used only if the jp2_colour object passed to init has exactly 1 colour channel. If jp2_colour::get_space already returns JP2_sLUM_SPACE this function may be called, but will do nothing.
The function compensates for differences between the tone reproduction curve of the input luminance data and the standard sRGB tone reproduction curve (gamma) used by JP2_sLUM_SPACE.
All conversions are performed in-situ, overwriting the original contents of the line buffer.
False if conversion is not possible. This happens only if init returned false, or was never called.
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.
If negative, the function processes all line.get_width samples in the line buffer. Otherwise, only the first width samples are processed (there must be at least this many samples.
| top || synopsis || return value || arguments || prev || next |