MIRA
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Lab Class Referenceabstract

Color in CIE Lab color space The CIE Lab color space is derived from the XYZ color space and is designed to approximate human vision. More...

#include <image/Color.h>

Inheritance diagram for Lab:
Inheritance graph
[legend]

Public Member Functions

 Lab (float iL, float ia, float ib)
 Constructs color in CIE Lab color space. More...
 
 Lab ()
 Default constructor Initializes L,a, and b with 0.0. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 
XYZ toXYZ () const
 Converts CIE Lab to CIE XYZ. More...
 
virtual Color::RGB toRGB () const
 Converts CIE Lab to RGB. More...
 
virtual operator cv::Scalar () const
 converts color to cv::Scalar Converts color to cv::Scalar by first converting to RGB and then creating a 4 channel cv::Scalar(B,G,R,255); More...
 
Class const & getClass () const
 call the virtual internalGetClass(). More...
 

Static Public Member Functions

static PseudoClass const & CLASS ()
 

Public Attributes

float L
 
float a
 
float b
 

Protected Member Functions

virtual Class const & internalGetClass () const =0
 

Detailed Description

Color in CIE Lab color space The CIE Lab color space is derived from the XYZ color space and is designed to approximate human vision.

It aspires to perceptual uniformity, and its L component closely matches human perception of lightness. It can thus be used to make accurate color balance corrections by modifying output curves in the a and b components, or to adjust the lightness contrast using the L component. The Lab color space is perceptually uniform, i.e. a change of the same amount in a color value should produce a change of about the same visual importance.

For more details see http://en.wikipedia.org/wiki/Lab_color_space.

Note
Since the CIE Lab color space (gamut) is larger than the RGB space, some CIE Lab colors cannot be represented by a corresponding RGB color. Hence, a conversation to a RGB color may result in a RGB color that is out of bounds.

Constructor & Destructor Documentation

◆ Lab() [1/2]

Lab ( float  iL,
float  ia,
float  ib 
)
inline

Constructs color in CIE Lab color space.

L: from 0 to 100 a: from -150 to 100 b: from -100 to 150

◆ Lab() [2/2]

Lab ( )
inline

Default constructor Initializes L,a, and b with 0.0.

Member Function Documentation

◆ reflect()

void reflect ( Reflector &  r)
inline

◆ toXYZ()

XYZ toXYZ ( ) const
inline

Converts CIE Lab to CIE XYZ.

Note
The CIE Lab color space may differ from the XYZ color space, hence some CIE Lab colors can result in XYZ colors that are out of bounds.

◆ toRGB()

virtual Color::RGB toRGB ( ) const
inlinevirtual

Converts CIE Lab to RGB.

Note
Since the CIE Lab color space is larger than the RGB space, the components of the resulting RGB color may be out of their valid ranges, i.e. some components may be negative or larger than 1.0. This happens, if a CIE Lab color cannot be represented by a RGB color. The range of the returned RGB color can be checked using the isInRange() method.

Implements ColorBase.

◆ operator cv::Scalar()

operator cv::Scalar ( ) const
inlinevirtualinherited

converts color to cv::Scalar Converts color to cv::Scalar by first converting to RGB and then creating a 4 channel cv::Scalar(B,G,R,255);

cast operator to cv::Scalar converts color to OpenCV BGRA format by scaling range to 0..255 and setting alpha channel to 255

Reimplemented in RGBA.

◆ getClass()

Class const& getClass ( ) const
inlineinherited

call the virtual internalGetClass().

◆ CLASS()

static PseudoClass const& CLASS ( )
inlinestaticinherited

◆ internalGetClass()

virtual Class const& internalGetClass ( ) const
protectedpure virtualinherited

Member Data Documentation

◆ L

float L

◆ a

float a

◆ b

float b

The documentation for this class was generated from the following file: