create_color_trans_lutT_create_color_trans_lutCreateColorTransLutCreateColorTransLutcreate_color_trans_lut (Operator)
Name
create_color_trans_lutT_create_color_trans_lutCreateColorTransLutCreateColorTransLutcreate_color_trans_lut
— Creates the look-up-table for transformation of an image from the
RGB color space to an arbitrary color space.
Signature
void CreateColorTransLut(const HTuple& ColorSpace, const HTuple& TransDirection, const HTuple& NumBits, HTuple* ColorTransLUTHandle)
static HColorTransLUT HImage::CreateColorTransLut(const HString& ColorSpace, const HString& TransDirection, Hlong NumBits)
static HColorTransLUT HImage::CreateColorTransLut(const char* ColorSpace, const char* TransDirection, Hlong NumBits)
static HColorTransLUT HImage::CreateColorTransLut(const wchar_t* ColorSpace, const wchar_t* TransDirection, Hlong NumBits)
(
Windows only)
void HColorTransLUT::HColorTransLUT(const HString& ColorSpace, const HString& TransDirection, Hlong NumBits)
void HColorTransLUT::HColorTransLUT(const char* ColorSpace, const char* TransDirection, Hlong NumBits)
void HColorTransLUT::HColorTransLUT(const wchar_t* ColorSpace, const wchar_t* TransDirection, Hlong NumBits)
(
Windows only)
void HColorTransLUT::CreateColorTransLut(const HString& ColorSpace, const HString& TransDirection, Hlong NumBits)
void HColorTransLUT::CreateColorTransLut(const char* ColorSpace, const char* TransDirection, Hlong NumBits)
void HColorTransLUT::CreateColorTransLut(const wchar_t* ColorSpace, const wchar_t* TransDirection, Hlong NumBits)
(
Windows only)
Description
The operator create_color_trans_lutcreate_color_trans_lutCreateColorTransLutCreateColorTransLutcreate_color_trans_lut
returns a look-up table
(LUT) for color space transformation of a 8 bit RGB image to a
different color space and vice versa. That means, this operator is
only valid for three channel images, where each channel has pixels
of type byte. If the input images have different domains, only the
intersection of the three input images is used for the
transformation.
The parameter ColorSpaceColorSpaceColorSpacecolorSpacecolor_space
identifies the initial or the target
color space transformation and the direction of the transformation is set
by TransDirectionTransDirectionTransDirectiontransDirectiontrans_direction
. ColorTransLUTHandleColorTransLUTHandleColorTransLUTHandlecolorTransLUTHandlecolor_trans_luthandle
contains the
handle of the created look-up-table.
Using a LUT significantly speeds up the process of transformation a
RGB image to another color space and vice versa with exception of
the 'yiq'"yiq""yiq""yiq""yiq", 'yuv'"yuv""yuv""yuv""yuv", 'argyb'"argyb""argyb""argyb""argyb", 'ciexyz'"ciexyz""ciexyz""ciexyz""ciexyz",
and 'i1i2i3'"i1i2i3""i1i2i3""i1i2i3""i1i2i3" color spaces.
Be aware that the LUT already needs 48MB of memory space.
For further information about the possible color space
transformations see the description of the operators
trans_from_rgbtrans_from_rgbTransFromRgbTransFromRgbtrans_from_rgb
and trans_to_rgbtrans_to_rgbTransToRgbTransToRgbtrans_to_rgb
.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.
Parameters
ColorSpaceColorSpaceColorSpacecolorSpacecolor_space
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Color space of the output image.
Default:
'hsv'
"hsv"
"hsv"
"hsv"
"hsv"
List of values:
'argyb'"argyb""argyb""argyb""argyb", 'cielab'"cielab""cielab""cielab""cielab", 'cielchab'"cielchab""cielchab""cielchab""cielchab", 'cielchuv'"cielchuv""cielchuv""cielchuv""cielchuv", 'cieluv'"cieluv""cieluv""cieluv""cieluv", 'ciexyz'"ciexyz""ciexyz""ciexyz""ciexyz", 'ciexyz3'"ciexyz3""ciexyz3""ciexyz3""ciexyz3", 'ciexyz4'"ciexyz4""ciexyz4""ciexyz4""ciexyz4", 'ciexyz4'"ciexyz4""ciexyz4""ciexyz4""ciexyz4", 'hls'"hls""hls""hls""hls", 'hls'"hls""hls""hls""hls", 'hsi'"hsi""hsi""hsi""hsi", 'hsv'"hsv""hsv""hsv""hsv", 'i1i2i3'"i1i2i3""i1i2i3""i1i2i3""i1i2i3", 'ihs'"ihs""ihs""ihs""ihs", 'lms'"lms""lms""lms""lms", 'yiq'"yiq""yiq""yiq""yiq", 'yuv'"yuv""yuv""yuv""yuv"
TransDirectionTransDirectionTransDirectiontransDirectiontrans_direction
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Direction of color space transformation.
Default:
'from_rgb'
"from_rgb"
"from_rgb"
"from_rgb"
"from_rgb"
List of values:
'from_rgb'"from_rgb""from_rgb""from_rgb""from_rgb", 'to_rgb'"to_rgb""to_rgb""to_rgb""to_rgb"
NumBitsNumBitsNumBitsnumBitsnum_bits
(input_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of bits of the input image.
Default:
8
List of values:
8
ColorTransLUTHandleColorTransLUTHandleColorTransLUTHandlecolorTransLUTHandlecolor_trans_luthandle
(output_control) color_trans_lut →
HColorTransLUT, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the look-up-table for color space
transformation.
Result
The operator create_color_trans_lutcreate_color_trans_lutCreateColorTransLutCreateColorTransLutcreate_color_trans_lut
returns the value 2 (
H_MSG_TRUE)
if the given parameters are correct and the look-up-table is
generated. Otherwise, an exception will be raised.
Possible Successors
apply_color_trans_lutapply_color_trans_lutApplyColorTransLutApplyColorTransLutapply_color_trans_lut
See also
apply_color_trans_lutapply_color_trans_lutApplyColorTransLutApplyColorTransLutapply_color_trans_lut
,
clear_color_trans_lutclear_color_trans_lutClearColorTransLutClearColorTransLutclear_color_trans_lut
Module
Foundation