|
VizKit
3.0
|
#include <VisualColorTools.h>
Static Public Member Functions | |
| static PixelColor | getPixelColor (const VertexColor &vertexColor) |
| static VertexColor | getVertexColor (const PixelColor &pixelColor) |
| static void | getColorComponentValues (const PixelColor &aPixelColor, uint8 &anAlpha, uint8 &aRed, uint8 &aGreen, uint8 &aBlue) |
| static PixelColor | getPixelColor (const uint8 &anAlpha, const uint8 &aRed, const uint8 &aGreen, const uint8 &aBlue) |
| static void | getMeanPixelColor (const PixelColor *colors, uint32 count, PixelColor &avgPixelColor) |
| static PixelColor | getMeanRGBPixelColor (const PixelColor &colorX, const PixelColor &colorY, const uint32 &count) |
| static void | RGBToHSL (const double &r, const double &g, const double &b, double *h, double *s, double *l) |
| static void | HSLToRGB (const double &h, const double &s, const double &l, double *r, double *g, double *b) |
| static void | RGBToHSV (const double &r, const double &g, const double &b, double *h, double *s, double *v) |
| static void | HSVToRGB (const double &h, const double &s, const double &v, double *r, double *g, double *b) |
| static void | convertInterleavedPixels1234To4321 (PixelColor *pixels, size_t numberOfPixels) |
| static void | convertInterleavedPixels1234To3214 (PixelColor *pixels, size_t numberOfPixels) |
| static void | convertARGBPixelToRGB (PixelColor &argbPixel) |
| static double | getDistance (const PixelColor &colorX, const PixelColor &colorY) |
| static PixelColor * | createARGBCheckPixels (size_t width, size_t height, const VertexColor &checkColor=red) |
| static PixelColor * | createBGRACheckPixels (size_t width, size_t height, const VertexColor &checkColor=red) |
| static PixelColor * | createRGBACheckPixels (size_t width, size_t height, const VertexColor &checkColor=red) |
| static PixelColor * | createABGRCheckPixels (size_t width, size_t height, const VertexColor &checkColor=red) |
Private Member Functions | |
| VisualColorTools () | |
| ~VisualColorTools () | |
Static Private Member Functions | |
| static double | min3 (const double &val1, const double &val2, const double &val3) |
| static double | max3 (const double &val1, const double &val2, const double &val3) |
| static double | hueToRGB (const double &v1, const double &v2, const double &hue) |
| static PixelColor * | createCheckPixels (size_t width, size_t height, const char *const format, const VertexColor &checkColor) |
Various utility functions dealing with pixel color values.
| VizKit::VisualColorTools::VisualColorTools | ( | ) | [private] |
The constructor. VisualColorTools is a collection of static methods. Class does not need any instances. Constructor is private and not implemented.
| VizKit::VisualColorTools::~VisualColorTools | ( | ) | [private] |
The destructor. VisualColorTools is a collection of static methods. Class does not need any instances. Destructor is private and not implemented.
| void VisualColorTools::convertARGBPixelToRGB | ( | PixelColor & | argbPixel | ) | [static] |
Performs a pixel conversion in-place. ARGB is converted to RGB with alpha value being premultiplied.
| [in,out] | argbPixel | An ARGB pixel (on return the ARGB pixel is converted to RGB with premultiplied alpha). |
| void VisualColorTools::convertInterleavedPixels1234To3214 | ( | PixelColor * | pixels, |
| size_t | numberOfPixels | ||
| ) | [static] |
Performs a pixel conversion in-place. E.g. BGRA pixel data is converted to RGBA.
| pixels | The buffer of 32bpp pixel data. |
| numberOfPixels | The number of pixels. |
| void VisualColorTools::convertInterleavedPixels1234To4321 | ( | PixelColor * | pixels, |
| size_t | numberOfPixels | ||
| ) | [static] |
Performs a pixel conversion in-place. E.g. ARGB pixel data is converted to BGRA.
| pixels | The buffer of 32bpp pixel data. |
| numberOfPixels | The number of pixels. |
| uint32 * VisualColorTools::createABGRCheckPixels | ( | size_t | width, |
| size_t | height, | ||
| const VertexColor & | checkColor = red |
||
| ) | [static] |
Creates an image buffer with 8-bit per color/alpha channel ABGR pixel data.
| width | The width of the bitmap data. |
| height | The height of the bitmap data. |
| checkColor | The color of the check squares of the sample image. |
| PixelColor * VisualColorTools::createARGBCheckPixels | ( | size_t | width, |
| size_t | height, | ||
| const VertexColor & | checkColor = red |
||
| ) | [static] |
Creates an image buffer with 8-bit per color/alpha channel ARGB pixel data.
| width | The width of the bitmap data. |
| height | The height of the bitmap data. |
| checkColor | The color of the check squares of the sample image. |
| uint32 * VisualColorTools::createBGRACheckPixels | ( | size_t | width, |
| size_t | height, | ||
| const VertexColor & | checkColor = red |
||
| ) | [static] |
Creates an image buffer with 8-bit per color/alpha channel BGRA pixel data.
| width | The width of the bitmap data. |
| height | The height of the bitmap data. |
| checkColor | The color of the check squares of the sample image. |
| PixelColor * VisualColorTools::createCheckPixels | ( | size_t | width, |
| size_t | height, | ||
| const char *const | format, | ||
| const VertexColor & | checkColor | ||
| ) | [static, private] |
Internal method to create an image buffer with 8-bit per color/alpha channel pixel data in given format (ARGB, BGRA, RGBA, ABGR).
| width | The width of the bitmap data. |
| height | The height of the bitmap data. |
| format | The format of the pixel data (e.g. ARGB). |
| checkColor | The color of the check squares of the sample image. |
| uint32 * VisualColorTools::createRGBACheckPixels | ( | size_t | width, |
| size_t | height, | ||
| const VertexColor & | checkColor = red |
||
| ) | [static] |
Creates an image buffer with 8-bit per color/alpha channel RGBA pixel data.
| width | The width of the bitmap data. |
| height | The height of the bitmap data. |
| checkColor | The color of the check squares of the sample image. |
| void VisualColorTools::getColorComponentValues | ( | const PixelColor & | aPixelColor, |
| uint8 & | anAlpha, | ||
| uint8 & | aRed, | ||
| uint8 & | aGreen, | ||
| uint8 & | aBlue | ||
| ) | [static] |
Returns the alpha, red, green, and blue color channel values.
| pixelColor | The pixelColor to analyze. | |
| [out] | alpha | The 8-bit value of the alpha component. |
| [out] | red | The 8-bit value of the red component. |
| [out] | green | The 8-bit value of the green component. |
| [out] | blue | The 8-bit value of the blue component. |
| double VisualColorTools::getDistance | ( | const PixelColor & | colorX, |
| const PixelColor & | colorY | ||
| ) | [static] |
Returns the distance between two RGB pixel values.
| colorX | One color. |
| colorY | The other color. |
| void VisualColorTools::getMeanPixelColor | ( | const PixelColor * | colors, |
| uint32 | count, | ||
| PixelColor & | avgPixelColor | ||
| ) | [static] |
Calculates the average pixel color for a number of pixel colors.
| colors | Array of pixel colors. | |
| count | The number of pixel colors to summarize. | |
| [out] | avgPixelColor | The average pixel color. |
| PixelColor VisualColorTools::getMeanRGBPixelColor | ( | const PixelColor & | colorX, |
| const PixelColor & | colorY, | ||
| const uint32 & | count | ||
| ) | [static] |
Returns the weighted average value.
| colorX | The existing color value. |
| colorY | The new incoming color value. |
| count | The number of existing color values. The new incoming color value (colorY) is weighted with 1 while the existing color value (colorX) is weighted with (count - 1). |
| PixelColor VisualColorTools::getPixelColor | ( | const VertexColor & | vertexColor | ) | [static] |
Converts from VertexColor to PixelColor.
| vertexColor | The vertexColor to convert. |
| PixelColor VisualColorTools::getPixelColor | ( | const uint8 & | anAlpha, |
| const uint8 & | aRed, | ||
| const uint8 & | aGreen, | ||
| const uint8 & | aBlue | ||
| ) | [static] |
Returns the Pixel color value for given alpha, red, green, and blue color channel values.
| [out] | alpha | The 8-bit value of the alpha component. |
| [out] | red | The 8-bit value of the red component. |
| [out] | green | The 8-bit value of the green component. |
| [out] | blue | The 8-bit value of the blue component. |
| VertexColor VisualColorTools::getVertexColor | ( | const PixelColor & | pixelColor | ) | [static] |
Converts from PixelColor to VertexColor.
| pixelColor | The pixelColor to convert. |
| void VisualColorTools::HSLToRGB | ( | const double & | h, |
| const double & | s, | ||
| const double & | l, | ||
| double * | r, | ||
| double * | g, | ||
| double * | b | ||
| ) | [static] |
Converts a color from HSL to RGB.
| h | Hue color value. | |
| s | Saturation color value. | |
| l | Lightness color value. | |
| [out] | r | Red color component value. |
| [out] | g | Green color component value. |
| [out] | b | Blue color component value. |
| void VisualColorTools::HSVToRGB | ( | const double & | h, |
| const double & | s, | ||
| const double & | v, | ||
| double * | r, | ||
| double * | g, | ||
| double * | b | ||
| ) | [static] |
Converts a color from HSV to RGB.
| h | Hue color value. | |
| s | Saturation color value. | |
| v | Value color value. | |
| [out] | r | Red color component value. |
| [out] | g | Green color component value. |
| [out] | b | Blue color component value. |
| double VisualColorTools::hueToRGB | ( | const double & | v1, |
| const double & | v2, | ||
| const double & | hue | ||
| ) | [static, private] |
Helper function to match hue to a red, green, or blue value.
| v1 | First value. |
| v2 | Second value. |
| hue | Hue value. |
| double VisualColorTools::max3 | ( | const double & | val1, |
| const double & | val2, | ||
| const double & | val3 | ||
| ) | [static, private] |
Returns the maximum value of three values.
| val1 | First value. |
| val2 | Second value. |
| val3 | Third value. |
| double VisualColorTools::min3 | ( | const double & | val1, |
| const double & | val2, | ||
| const double & | val3 | ||
| ) | [static, private] |
Returns the minimum value of three values.
| val1 | First value. |
| val2 | Second value. |
| val3 | Third value. |
| void VisualColorTools::RGBToHSL | ( | const double & | r, |
| const double & | g, | ||
| const double & | b, | ||
| double * | h, | ||
| double * | s, | ||
| double * | l | ||
| ) | [static] |
Converts a color from RGB to HSL.
| r | Red color component value. | |
| g | Green color component value. | |
| b | Blue color component value. | |
| [out] | h | Hue color value. |
| [out] | s | Saturation color value. |
| [out] | l | Lightness color value. |
| void VisualColorTools::RGBToHSV | ( | const double & | r, |
| const double & | g, | ||
| const double & | b, | ||
| double * | h, | ||
| double * | s, | ||
| double * | v | ||
| ) | [static] |
Converts a color from RGB to HSV.
| r | Red color component value. | |
| g | Green color component value. | |
| b | Blue color component value. | |
| [out] | h | Hue color value. |
| [out] | s | Saturation color value. |
| [out] | v | Value color value. |