Color values of different color formats (described here) are stored in tlColor objects. They are used as arguments to color filtering and color extraction routines.
tlColor::tlColor | ( | ) |
tlColor::tlColor | ( | tlColor * | src | ) |
Constructor, creates a copy of an existing color.
src | color to copy |
Constructor, initializes color format to RGB.
r | R color values [0..255] | |
g | G color values [0..255] | |
b | B color values [0..255] |
Constructor, initialises color format to HSI.
h1 | H1 (coarse) color values [0..255] | |
h2 | H2 (fine) color values [0..255] | |
s | S color values [0..255] | |
i | I color values [0..255] |
Constructor, initializes color format to NRG.
nr | NR color value [0..255] | |
ng | NG color value [0..255] |
tlColor::tlColor | ( | tlPixel | intensity | ) |
Constructor, initializes color format to GRAY.
intensity | GRAY color values [0..255] |
tlColor::~tlColor | ( | ) | [virtual] |
int tlColor::copy | ( | tlColor * | color | ) |
Copy data from another color.
color | color to copy |
int tlColor::copyTo | ( | tlColor * | color | ) |
Copy data to another color.
color | [out] color to copy to |
int tlColor::setChannel | ( | int | channel, | |
tlPixel | val | |||
) |
Set color value for a particular channel.
channel | channel to be affected | |
val | new channel value |
int tlColor::swapChannels | ( | int | channel1, | |
int | channel2 | |||
) |
Swap two channel values.
channel1 | channel to be swapped | |
channel2 | channel to be swapped |
int tlColor::set | ( | tlPixelArray * | pixelArray, | |
tlPoint * | point | |||
) |
Set the color argument to the pixel value of a given pixel array.
pixelArray | source pixel array to get color from | |
point | pixel to consider in the pixel array |
int tlColor::set | ( | tlPixelArray * | pixelArray, | |
int | x, | |||
int | y | |||
) |
Set the color argument to the pixel value of a given pixel array.
pixelArray | source pixel array to get color from | |
x | X coord of the pixel to consider | |
y | Y coord of the pixel to consider |
Set the RGB color value.
r | R color value [0..255] | |
g | G color value [0..255] | |
b | B color value [0..255] |
Set the YUV color value.
y | Y color value [0..255] | |
u | U color value [0..255] | |
v | V color value [0..255] |
Set NRG color value.
nr | NR color value [0..255] | |
ng | NG color value [0..255]; |
Set HSI color value.
h1 | H (coarse) color values [0..255] | |
h2 | H (fine) color values [0..255] | |
s | S color values [0..255] | |
i | I color values [0..255] |
int tlColor::setGray | ( | tlPixel | intensity | ) |
Set GRAY color value.
intensity | GRAY color value [0..255] |
int tlColor::setMin | ( | tlPixelArray * | pixelArray, | |
tlRect * | rect | |||
) |
Set color to the lowest value in a portion of a given pixel array; color takes the format of the input pixel array.
pixelArray | the pixel array to extract the color from | |
rect | the portion of the pixel array to consider |
int tlColor::setMax | ( | tlPixelArray * | pixelArray, | |
tlRect * | rect | |||
) |
Set color to the highest value in a portion of a given pixel array; color takes the format of the input pixel array.
pixelArray | the pixel array to extract the color from | |
rect | the portion of the pixel array to consider |
int tlColor::setVar | ( | tlPixelArray * | pixelArray, | |
tlRect * | rect | |||
) |
Set color to the maximum variation in a portion of a given pixel array; color takes the format of the input pixel array.
pixelArray | the pixel array to extract the color from | |
rect | the portion of the pixel array to consider |
int tlColor::toRgb | ( | ) |
Convert color to RGB format (if possible).
int tlColor::toNrg | ( | ) |
Convert color to NRG format (if possible).
int tlColor::toHsi | ( | ) |
Convert color to HSI format (if possible).
int tlColor::toGray | ( | ) |
Convert color to GRAY format if (possible).
int tlColor::toBin | ( | int | threshold | ) |
Convert color to BIN format if (possible).
threshold | threshold value for pixel (de)activation |
int tlColor::add | ( | tlColor * | color | ) |
Perform color addition.
color | color to add to current color |
Perform color addition; the result is placed in another color object.
color | color to add to current color | |
dest | [out] destination color |
int tlColor::sub | ( | tlColor * | color | ) |
Perform color subtraction.
color | color to sub from current color |
Perform color subtraction; the result is placed in another color object.
color | color to sub from current color | |
dest | destination color |
Color format.
tlPixel tlColor::raw[TL_MAX_CHANNEL] |
Raw (unspecified) format.
GRAY (intensity) component.
R (red) component.
G (green) component.
B (blue) component.
Y (luma) component.
U (R-Y) component.
V (B-Y) component.
NR (normalized red) component.
NG (normalized green) component.
H1 (hue, coarse) component.
H2 (hue, fine) component.
S (saturation) component.
I (intensity) component.