Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::ColorTransform Class Reference

#include <Color.h>

List of all members.


Detailed Description

Contains methods for color space transforms that cannot be implemeted without some external knowledge.

Transformations that do not need additional information (RGB<->HSV) are implemented simply as typecasts. This class lso contains static matrices for color space transforms.


Static Public Methods

Color< double, 3 > XYZToCIELAB (const Color< double, 3 > &xyzColor, const Color< double, 3 > &whitePoint)
 Convert a color in XYZ color space into the CIELAB space.

template<class T> Color< T, 3 > RGBToHSV (const Color< T, 3 > &rgbColor)
 Convert a color from the RGB space to HSV.

template<class T> Color< T, 3 > HSVToRGB (const Color< T, 3 > &hsvColor)
 Convert a color from the HSV space to RGB.

template<class T, int c> Color< double, c > normalize (const Color< T, c > &clr)
 Normalize a color.


Static Public Attributes

util::Matrix< double > ohtaKanabe
 A 3-by-3 matrix for transforming a color from the RGB color model to the one defined by Ohta and Kanabe.

util::Matrix< double > D65_709_XYZ
 The "standard" matrix for RGB to XYZ conversion.


Member Function Documentation

template<class T>
Color< T, 3 > prapi::ColorTransform::HSVToRGB const Color< T, 3 > &    hsvColor [static]
 

Convert a color from the HSV space to RGB.

For integer-valued HSV colors, the saturation channel must be in the range [0,255]. Preferably, the value channel should also be in this range. The hue channel must be in [0,360) independent of the content type. For floating point content types, saturation must and value should be in the range [0,1].

Parameters:
hsvColor  the color to be converted
Returns:
the same color in the RGB space

template<class T, int c>
Color< double, c > prapi::ColorTransform::normalize const Color< T, c > &    clr [static]
 

Normalize a color.

A normalized color is created by dividing color channels by the sum of all channels. Typically, this operation is used to get chromaticity information.

template<class T>
Color< T, 3 > prapi::ColorTransform::RGBToHSV const Color< T, 3 > &    rgbColor [static]
 

Convert a color from the RGB space to HSV.

If the type of the color is float or double, values must be in the range [0,1]. If the type is int, values must be in the range [0,255]. For other types, the behavior is undefined.

Parameters:
rgbColor  the color to be converted
Returns:
the same color in the HSV space

Color< double, 3 > prapi::ColorTransform::XYZToCIELAB const Color< double, 3 > &    xyzColor,
const Color< double, 3 > &    whitePoint
[static]
 

Convert a color in XYZ color space into the CIELAB space.

Parameters:
xyzColor  the color to be converted to CIELAB
whitePoint  the XYZ coordinates of the white point of the imaging equipment. Make sure this value has no zero components.


Member Data Documentation

Matrix< double > prapi::ColorTransform::D65_709_XYZ [static]
 

The "standard" matrix for RGB to XYZ conversion.

Assumes ITU-R BT.709 camera primaries and D65 white point.


The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.