PCL
pcl::RGBColorSystem Class Reference

A colorimetrically defined RGB working color space. More...

#include <RGBColorSystem.h>

Public Types

typedef double sample
 

Public Member Functions

 RGBColorSystem ()
 
 RGBColorSystem (const RGBColorSystem &s)
 
 RGBColorSystem (float gamma, bool issRGB, const FVector &x, const FVector &y, const FVector &Y)
 
 RGBColorSystem (float gamma, bool issRGB, const float *x, const float *y, const float *Y)
 
virtual ~RGBColorSystem ()
 
void Assign (const RGBColorSystem &s)
 
const FVectorChromaticityXCoordinates () const
 
const FVectorChromaticityYCoordinates () const
 
sample CIEa (sample R, sample G, sample B) const
 
sample CIEb (sample R, sample G, sample B) const
 
sample CIEc (sample R, sample G, sample B) const
 
sample CIEh (sample R, sample G, sample B) const
 
sample CIEhr (sample R, sample G, sample B) const
 
sample CIEL (sample R, sample G, sample B) const
 
void CIELabToCIELch (sample &L, sample &c, sample &h, sample L0, sample a, sample b) const
 
void CIELabToCIEXYZ (sample &X, sample &Y, sample &Z, sample L, sample a, sample b) const
 
void CIELabToRGB (sample &R, sample &G, sample &B, sample L, sample a, sample b) const
 
void CIELchToCIELab (sample &L, sample &a, sample &b, sample L0, sample c, sample h) const
 
void CIELchToRGB (sample &R, sample &G, sample &B, sample L, sample c, sample h) const
 
sample CIELToCIEY (sample L) const
 
sample CIEX (sample R, sample G, sample B) const
 
void CIEXYZToCIELab (sample &L, sample &a, sample &b, sample X, sample Y, sample Z) const
 
void CIEXYZToRGB (sample &R, sample &G, sample &B, sample X, sample Y, sample Z) const
 
sample CIEY (sample R, sample G, sample B) const
 
sample CIEYToCIEL (sample Y) const
 
sample CIEZ (sample R, sample G, sample B) const
 
void EnsureUnique ()
 
float Gamma () const
 
void HSILToRGB (sample &R, sample &G, sample &B, sample H, sample S, sample I, sample L) const
 
sample HSISaturation (sample R, sample G, sample B) const
 
void HSVLToRGB (sample &R, sample &G, sample &B, sample H, sample S, sample V, sample L) const
 
sample HSVSaturation (sample R, sample G, sample B) const
 
sample Hue (sample R, sample G, sample B) const
 
sample Intensity (sample R, sample G, sample B) const
 
bool IsAliasOf (const RGBColorSystem &s) const
 
bool IsLinear () const
 
bool IsSRGB () const
 
bool IsUnique () const
 
sample Lightness (sample R, sample G, sample B) const
 
const FVectorLuminanceCoefficients () const
 
RGBColorSystemoperator= (const RGBColorSystem &s)
 
void RGBToCIEab (sample &a, sample &b, sample R, sample G, sample B) const
 
void RGBToCIELab (sample &L, sample &a, sample &b, sample R, sample G, sample B) const
 
void RGBToCIELabc (sample &L, sample &a, sample &b, sample &c, sample R, sample G, sample B) const
 
void RGBToCIELch (sample &L, sample &c, sample &h, sample R, sample G, sample B) const
 
void RGBToCIEXYZ (sample &X, sample &Y, sample &Z, sample R, sample G, sample B) const
 
void RGBToCIEXZ (sample &X, sample &Z, sample R, sample G, sample B) const
 
void RGBToGray (sample &K, sample R, sample G, sample B) const
 
void RGBToHSIL (sample &H, sample &S, sample &I, sample &L, sample R, sample G, sample B) const
 
void RGBToHSVL (sample &H, sample &S, sample &V, sample &L, sample R, sample G, sample B) const
 
const VectorRGBToXYZMatrix () const
 
sample Saturation (sample R, sample G, sample B) const
 
sample Value (sample R, sample G, sample B) const
 
const VectorXYZToRGBMatrix () const
 

Static Public Member Functions

static void HSIToRGB (sample &R, sample &G, sample &B, sample H, sample S, sample I)
 
static void HSVToRGB (sample &R, sample &G, sample &B, sample H, sample S, sample V)
 
static void RGBToHSI (sample &H, sample &S, sample &I, sample R, sample G, sample B)
 
static void RGBToHSV (sample &H, sample &S, sample &V, sample R, sample G, sample B)
 

Static Public Attributes

static const RGBColorSystem sRGB
 
static const float sRGB_x [3]
 
static const float sRGB_y [3]
 
static const float sRGB_Y [3]
 

Friends

bool operator== (const RGBColorSystem &S1, const RGBColorSystem &S2)
 

Detailed Description

RGBColorSystem is a rigorous and efficient implementation of a RGB working space (RGBWS). This class provides all conversions between the supported color spaces: RGB, CIE XYZ, CIE L*a*b*, CIE L*c*h* and grayscale, plus the HSV and HSI color ordering systems, which are also supported for convenience, although obviously not linked to any particular RGBWS.

Color components and channel values are represented as reals by means of double floating point variables. Normalization of components and channel values to the standard real range [0,1] is ensured for all supported color spaces and color ordering systems.

Chrominance coordinates and luminance coefficients are always considered relative to the D50 reference white, in conformance to the ICC standard.

Finally, our implementation maximizes dynamic range usage (coding efficiency) by ensuring that all components and channel values make use of the entire [0,1] normalized real range to the maximum possible extent.

See also
ImageColor, AbstractImage, GenericImage, ImageVariant

Definition at line 104 of file RGBColorSystem.h.

Member Typedef Documentation

◆ sample

The type used to represent components and channel values for all supported color spaces and color ordering systems.

Definition at line 112 of file RGBColorSystem.h.

Constructor & Destructor Documentation

◆ RGBColorSystem() [1/4]

pcl::RGBColorSystem::RGBColorSystem ( )
inline

Constructs a RGBColorSystem object as a new instance of the default RGB working space. The default RGBWS is sRGB in current versions of the PixInsight platform.

This constructor increments the reference counter of the source RGB working space data.

Definition at line 122 of file RGBColorSystem.h.

◆ RGBColorSystem() [2/4]

pcl::RGBColorSystem::RGBColorSystem ( const RGBColorSystem s)
inline

Constructs a RGBColorSystem object as a copy of an existing instance.

This constructor increments the reference counter of the source RGB working space data.

Definition at line 136 of file RGBColorSystem.h.

◆ RGBColorSystem() [3/4]

pcl::RGBColorSystem::RGBColorSystem ( float  gamma,
bool  issRGB,
const FVector x,
const FVector y,
const FVector Y 
)
inline

Constructs a new RGBColorSystem instance by its RGB working space parameters.

Parameters
gammaGamma value of the RGB working space.
issRGBIf true, this space uses the sRGB gamma function. If this parameter is false, the space uses a standard raise gamma function.
x,yVectors of chromaticity coordinates of the RGB working space, relative to the D50 reference white.
YVector of luminance coefficients of the RGB working space, with respect to the D50 reference white.

This constructor creates a new RGB working space data object with a reference count value of one.

Definition at line 160 of file RGBColorSystem.h.

◆ RGBColorSystem() [4/4]

pcl::RGBColorSystem::RGBColorSystem ( float  gamma,
bool  issRGB,
const float *  x,
const float *  y,
const float *  Y 
)
inline

Constructs a new RGBColorSystem instance by its RGB working space parameters.

Parameters
gammaGamma value of the RGB working space.
issRGBIf true, this space uses the sRGB gamma function. If this parameter is false, the space uses a standard raise gamma function.
x,yArrays of chromaticity coordinates of the RGB working space, relative to the D50 reference white.
YArrays of luminance coefficients of the RGB working space, with respect to the D50 reference white.

This constructor creates a new RGB working space data object with a reference count value of one.

Definition at line 184 of file RGBColorSystem.h.

◆ ~RGBColorSystem()

virtual pcl::RGBColorSystem::~RGBColorSystem ( )
inlinevirtual

Destroys a RGBColorSystem instance.

Decrements the reference count of the RGB working space data object. If the data object becomes garbage, i.e. if its reference count becomes zero, it is destroyed and its allocated space is disposed.

Definition at line 196 of file RGBColorSystem.h.

Member Function Documentation

◆ Assign()

void pcl::RGBColorSystem::Assign ( const RGBColorSystem s)
inline

Causes this RGBColorSystem instance to reference the same RGB working space as another instance.

The reference count of the previously referenced space is decremented, and the previous space is deleted if it becomes unreferenced. The reference count of the new space is then incremented.

Definition at line 357 of file RGBColorSystem.h.

◆ ChromaticityXCoordinates()

const FVector& pcl::RGBColorSystem::ChromaticityXCoordinates ( ) const
inline

Returns a reference to the immutable vector of X chromaticity coordinates in this RGB working space.

In PCL, chromaticity coordinates are relative to the D50 reference white.

Definition at line 312 of file RGBColorSystem.h.

◆ ChromaticityYCoordinates()

const FVector& pcl::RGBColorSystem::ChromaticityYCoordinates ( ) const
inline

Returns a reference to the immutable vector of Y chromaticity coordinates in this RGB working space.

In PCL, chromaticity coordinates are relative to the D50 reference white.

Definition at line 323 of file RGBColorSystem.h.

◆ CIEa()

sample pcl::RGBColorSystem::CIEa ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the a* chrominance component in the CIE L*a*b* color space, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.

This function avoids calculation of the L* and b* components, which saves computing time when only the a* component is required.

Definition at line 810 of file RGBColorSystem.h.

◆ CIEb()

sample pcl::RGBColorSystem::CIEb ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the b* chrominance component in the CIE L*a*b* color space, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.

This function avoids the calculation of the L* and a* channels, which saves computing time when only the b* chrominance component is required.

Definition at line 827 of file RGBColorSystem.h.

◆ CIEc()

sample pcl::RGBColorSystem::CIEc ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the c* chrominance component in the CIE L*c*h* color space, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.

This function avoids the calculation of the L* and h* channels, which saves computing time when only the c* chrominance component is required.

Definition at line 844 of file RGBColorSystem.h.

◆ CIEh()

sample pcl::RGBColorSystem::CIEh ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the normalized h* chrominance component in the CIE L*c*h* color space, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.

This function avoids the calculation of the L* and c* channels, which saves computing time when only the h* chrominance component is required.

The returned value is the hue angle normalized to the range [0,1[, where 0 corresponds to a hue angle of zero degrees, and 1 to an angle of 360 degrees (2*pi radians).

Definition at line 867 of file RGBColorSystem.h.

References pcl::Const< T >::_2pi().

◆ CIEhr()

sample pcl::RGBColorSystem::CIEhr ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the h* chrominance component in the CIE L*c*h* color space, expressed in radians, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.

This function avoids the calculation of the L* and c* channels, which saves computing time when only the h* chrominance component is required.

The returned value is the hue angle in radians, in the range [0,2pi[.

Definition at line 883 of file RGBColorSystem.h.

◆ CIEL()

sample pcl::RGBColorSystem::CIEL ( sample  R,
sample  G,
sample  B 
) const
inline

A synonym for Lightness().

Definition at line 398 of file RGBColorSystem.h.

◆ CIELabToCIELch()

void pcl::RGBColorSystem::CIELabToCIELch ( sample L,
sample c,
sample h,
sample  L0,
sample  a,
sample  b 
) const
inline

Conversion from the CIE L*a*b* color space to the CIE L*c*h* color space.

Parameters
[out]L,c,hReferences to the variables where output CIE L*c*h* components will be copied.
L0,a,bInput CIE L*a*b* components.
Note
The output L component is always identical to the input L0 component; the L parameter of this function has been included for the sake of coherence in function signatures.

Definition at line 1169 of file RGBColorSystem.h.

◆ CIELabToCIEXYZ()

void pcl::RGBColorSystem::CIELabToCIEXYZ ( sample X,
sample Y,
sample Z,
sample  L,
sample  a,
sample  b 
) const
inline

Conversion from the CIE L*a*b* color space to the CIE XYZ color space.

Parameters
[out]X,Y,ZReferences to the variables where output CIE XYZ components will be copied.
L,a,bInput CIE L*a*b* components.

Definition at line 1149 of file RGBColorSystem.h.

◆ CIELabToRGB()

void pcl::RGBColorSystem::CIELabToRGB ( sample R,
sample G,
sample B,
sample  L,
sample  a,
sample  b 
) const
inline

Conversion from the CIE L*a*b* color space to the RGB color space.

Parameters
[out]R,G,BReferences to the variables where output RGB components will be copied.
L,a,bInput CIE L*a*b* components.

Definition at line 1134 of file RGBColorSystem.h.

◆ CIELchToCIELab()

void pcl::RGBColorSystem::CIELchToCIELab ( sample L,
sample a,
sample b,
sample  L0,
sample  c,
sample  h 
) const
inline

Conversion from the CIE L*c*h* color space to the CIE L*a*b* color space.

Parameters
[out]L,a,bReferences to the variables where output CIE L*a*b* components will be copied.
L0,c,hInput CIE L*c*h* components.
Note
The output L component is always identical to the input L0 component; the L parameter of this function has been included for the sake of coherence in function signatures.

Definition at line 1214 of file RGBColorSystem.h.

◆ CIELchToRGB()

void pcl::RGBColorSystem::CIELchToRGB ( sample R,
sample G,
sample B,
sample  L,
sample  c,
sample  h 
) const
inline

Conversion from the CIE L*c*h* color space to the RGB color space.

Parameters
[out]R,G,BReferences to the variables where output RGB components will be copied.
L,c,hInput CIE L*c*h* components.

Definition at line 1188 of file RGBColorSystem.h.

◆ CIELToCIEY()

sample pcl::RGBColorSystem::CIELToCIEY ( sample  L) const
inline

CIE Y component from CIE L*.

Parameters
LSource CIE L* component.

Definition at line 760 of file RGBColorSystem.h.

◆ CIEX()

sample pcl::RGBColorSystem::CIEX ( sample  R,
sample  G,
sample  B 
) const
inline

CIE X component from RGB components.

Parameters
R,G,BInput RGB components.

Definition at line 720 of file RGBColorSystem.h.

◆ CIEXYZToCIELab()

void pcl::RGBColorSystem::CIEXYZToCIELab ( sample L,
sample a,
sample b,
sample  X,
sample  Y,
sample  Z 
) const
inline

Conversion from the CIE XYZ color space to the CIE L*a*b* color space.

Parameters
[out]L,a,bReferences to the variables where output CIE L*a*b* components will be copied.
X,Y,ZInput CIE XYZ components.

Definition at line 1118 of file RGBColorSystem.h.

◆ CIEXYZToRGB()

void pcl::RGBColorSystem::CIEXYZToRGB ( sample R,
sample G,
sample B,
sample  X,
sample  Y,
sample  Z 
) const
inline

Conversion from the CIE XYZ color space to the RGB color space.

Parameters
[out]R,G,BReferences to the variables where output RGB components will be copied.
X,Y,ZInput CIE XYZ components.

Definition at line 1105 of file RGBColorSystem.h.

◆ CIEY()

sample pcl::RGBColorSystem::CIEY ( sample  R,
sample  G,
sample  B 
) const
inline

CIE Y component from RGB components.

Parameters
R,G,BInput RGB components.

Definition at line 730 of file RGBColorSystem.h.

◆ CIEYToCIEL()

sample pcl::RGBColorSystem::CIEYToCIEL ( sample  Y) const
inline

CIE L* component from CIE Y.

Parameters
YSource CIE Y component.

Definition at line 750 of file RGBColorSystem.h.

◆ CIEZ()

sample pcl::RGBColorSystem::CIEZ ( sample  R,
sample  G,
sample  B 
) const
inline

CIE Z component from RGB components.

Parameters
R,G,BInput RGB components.

Definition at line 740 of file RGBColorSystem.h.

◆ EnsureUnique()

void pcl::RGBColorSystem::EnsureUnique ( )
inline

Ensures that this RGBColorSystem object uniquely references its RGB working space data.

If necessary, this member function generates a duplicate of the RGB working space data, references it, and then decrements the reference counter of the original data.

Definition at line 234 of file RGBColorSystem.h.

◆ Gamma()

float pcl::RGBColorSystem::Gamma ( ) const
inline

Returns the gamma value of this RGB working space.

Note
If this space uses a sRGB gamma function, the returned value is 2.2, but the space doesn't use that value as the exponent of a standard raise gamma function.

Definition at line 251 of file RGBColorSystem.h.

◆ HSILToRGB()

void pcl::RGBColorSystem::HSILToRGB ( sample R,
sample G,
sample B,
sample  H,
sample  S,
sample  I,
sample  L 
) const
inline

Transformation from separate HSI chrominance and CIE L* components to the RGB color space.

Parameters
[out]R,G,BReferences to the variables where output RGB components will be copied.
H,S,IInput HSI channel values for chrominance.
LInput CIE L* component (lightness).

The lightness implicitly defined by the input HSI values is discarded and replaced with the specified CIE L* component.

Strictly speaking, the resulting chrominance is not colorimetrically defined, since it derives from HSI channel values. However, the chrominance is supposed to be expressed in the RGB working space referenced by this RGBColorSystem instance.

The input H value must be a normalized hue, which is the hue angle rescaled to the normalized [0,1] range. A normalized hue value of one corresponds to a hue angle of 2*pi radians, or 360 degrees.

The primary usefulness of this function is implementing accurate hue/saturation image transformations in the HSI system with full preservation of the CIE lightness component.

Note
HSI is more often known as HSL; however we reserve the L channel identifier exclusively for the CIE L* component (lightness) in PCL.

Definition at line 1086 of file RGBColorSystem.h.

◆ HSISaturation()

sample pcl::RGBColorSystem::HSISaturation ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the Saturation channel value in the HSI color ordering system, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.
Note
HSI is more often known as HSL; however we reserve the L channel identifier exclusively for the CIE L* component (lightness) in PCL.
This is an utility function provided for convenience; HSI is not a color space, but a color ordering system not based on a RGBWS.

Definition at line 515 of file RGBColorSystem.h.

References pcl::Max(), and pcl::Min().

◆ HSIToRGB()

static void pcl::RGBColorSystem::HSIToRGB ( sample R,
sample G,
sample B,
sample  H,
sample  S,
sample  I 
)
inlinestatic

Conversion from the HSI color ordering system to the RGB color space.

Parameters
[out]R,G,BReferences to the variables where output RGB components will be copied.
H,S,IInput HSI channel values.

The input H value must be a normalized hue, which is the hue angle rescaled to the normalized [0,1] range. A normalized hue value of one corresponds to a hue angle of 2*pi radians, or 360 degrees.

Note
HSI is more often known as HSL; however we reserve the L channel identifier exclusively for the CIE L* component (lightness) in PCL.
This is a static function provided for convenience; HSI is not a color space, but a color ordering system not based on a RGBWS.

Definition at line 1042 of file RGBColorSystem.h.

◆ HSVLToRGB()

void pcl::RGBColorSystem::HSVLToRGB ( sample R,
sample G,
sample B,
sample  H,
sample  S,
sample  V,
sample  L 
) const
inline

Transformation from separate HSV chrominance and CIE L* components to the RGB color space.

Parameters
[out]R,G,BReferences to the variables where output RGB components will be copied.
H,S,VInput HSV channel values for chrominance.
LInput CIE L* (lightness) component.

The lightness implicitly defined by the input HSV values is discarded and replaced with the specified CIE L* component.

Strictly speaking, the resulting chrominance is not colorimetrically defined, since it derives from HSV channel values. However, the chrominance is supposed to be expressed in the RGB working space referenced by this RGBColorSystem instance.

The input H value must be a normalized hue, which is the hue angle rescaled to the normalized [0,1] range. A normalized hue value of one corresponds to a hue angle of 2*pi radians, or 360 degrees.

The primary usefulness of this function is implementing accurate hue/saturation image transformations in the HSV system with full preservation of the CIE lightness component.

Definition at line 1013 of file RGBColorSystem.h.

◆ HSVSaturation()

sample pcl::RGBColorSystem::HSVSaturation ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the Saturation channel value in the HSV color ordering system, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.
Note
This is an utility function provided for convenience; HSV is not a color space, but a color ordering system not based on a RGBWS.

Definition at line 496 of file RGBColorSystem.h.

References pcl::Max(), and pcl::Min().

◆ HSVToRGB()

static void pcl::RGBColorSystem::HSVToRGB ( sample R,
sample G,
sample B,
sample  H,
sample  S,
sample  V 
)
inlinestatic

Conversion from the HSV color ordering system to the RGB color space.

Parameters
[out]R,G,BReferences to the variables where output RGB components will be copied.
H,S,VInput HSV channel values.

The input H value must be a normalized hue, which is the hue angle rescaled to the normalized [0,1] range. A normalized hue value of one corresponds to a hue angle of 2*pi radians, or 360 degrees.

Note
This is a static function provided for convenience; HSV is not a color space, but a color ordering system not based on a RGBWS.

Definition at line 959 of file RGBColorSystem.h.

◆ Hue()

sample pcl::RGBColorSystem::Hue ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the Hue channel value in the HSV and HSI color ordering systems, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.

The returned value is a normalized hue, which is the hue angle rescaled to the normalized [0,1[ range. A normalized hue value of 1 corresponds to a hue angle of 2*pi radians, or 360 degrees.

Note
This is an utility function, provided for convenience. HSV and HSI are not color spaces, but color ordering systems not based on any RGBWS.

Definition at line 462 of file RGBColorSystem.h.

References pcl::Max(), and pcl::Min().

◆ Intensity()

sample pcl::RGBColorSystem::Intensity ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the Intensity channel value in the HSI color ordering system, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.
Note
HSI is more often known as HSL; however we reserve the L channel identifier exclusively for the CIE L* component (lightness) in PCL.
This is an utility function provided for convenience; HSI is not a color space, but a color ordering system not based on a RGBWS.

Definition at line 443 of file RGBColorSystem.h.

References pcl::Max(), and pcl::Min().

◆ IsAliasOf()

bool pcl::RGBColorSystem::IsAliasOf ( const RGBColorSystem s) const
inline

Returns true iff this RGBColorSystem object is an alias of another RGBColorSystem instance s.

Two instances of RGBColorSystem are aliases if both share the same RGB working space data.

Definition at line 221 of file RGBColorSystem.h.

◆ IsLinear()

bool pcl::RGBColorSystem::IsLinear ( ) const
inline

Returns true iff this space uses a linear gamma function.

A linear RGB space has gamma=1 and doesn't use a sRGB gamma function.

Definition at line 269 of file RGBColorSystem.h.

◆ IsSRGB()

bool pcl::RGBColorSystem::IsSRGB ( ) const
inline

Returns true iff this space uses a sRGB gamma function.

Definition at line 259 of file RGBColorSystem.h.

◆ IsUnique()

bool pcl::RGBColorSystem::IsUnique ( ) const
inline

Returns true iff this RGBColorSystem object uniquely references its RGB working space data.

Definition at line 209 of file RGBColorSystem.h.

◆ Lightness()

sample pcl::RGBColorSystem::Lightness ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the lightness component in the CIE L*a*b* space corresponding to a set of specified RGB components.

Parameters
R,G,BRGB components from which lightness will be calculated.
Note
A synonym for this function is CIEL().

Definition at line 383 of file RGBColorSystem.h.

◆ LuminanceCoefficients()

const FVector& pcl::RGBColorSystem::LuminanceCoefficients ( ) const
inline

Returns a reference to the immutable vector of luminance coefficients in this RGB working space.

In PCL, luminance coefficients are relative to the D50 reference white.

Definition at line 334 of file RGBColorSystem.h.

◆ operator=()

RGBColorSystem& pcl::RGBColorSystem::operator= ( const RGBColorSystem s)
inline

Assignment iterator. Returns a reference to this object.

This operator calls Assign() with the specified source space s.

Definition at line 369 of file RGBColorSystem.h.

◆ RGBToCIEab()

void pcl::RGBColorSystem::RGBToCIEab ( sample a,
sample b,
sample  R,
sample  G,
sample  B 
) const
inline

Calculates the chrominance components in the CIE L*a*b* color space corresponding to a specified set of RGB components.

Parameters
[out]a,bReferences to the variables where output CIE a* and b* components will be copied.
R,G,BInput RGB components.

This function avoids the calculation of the CIE L* component, which saves computing time when only the chrominance components are required.

Definition at line 792 of file RGBColorSystem.h.

◆ RGBToCIELab()

void pcl::RGBColorSystem::RGBToCIELab ( sample L,
sample a,
sample b,
sample  R,
sample  G,
sample  B 
) const
inline

Conversion from the RGB color space to the CIE L*a*b* color space.

Parameters
[out]L,a,bReferences to the variables where output CIE L*a*b* components will be copied.
R,G,BInput RGB components.

Definition at line 773 of file RGBColorSystem.h.

◆ RGBToCIELabc()

void pcl::RGBColorSystem::RGBToCIELabc ( sample L,
sample a,
sample b,
sample c,
sample  R,
sample  G,
sample  B 
) const
inline

Conversion from the RGB color space to the CIE L*a*b* color space, with optimized, on-the-fly calculation of the CIE c* component.

Parameters
[out]L,a,bReferences to the variables where output CIE L*a*b* components will be copied.
[out]cReference to a variable where the output CIE c* component will be copied.
R,G,BInput RGB components.

If only the CIE c* component is required besides CIE L*a*b* components, this function is much faster than performing two separate conversions to the CIE L*a*b* and L*c*h* color spaces.

Definition at line 933 of file RGBColorSystem.h.

◆ RGBToCIELch()

void pcl::RGBColorSystem::RGBToCIELch ( sample L,
sample c,
sample h,
sample  R,
sample  G,
sample  B 
) const
inline

Conversion from the RGB color space to the CIE L*c*h* color space.

Parameters
[out]L,c,hReferences to the variables where output CIE L*c*h* components will be copied.
R,G,BInput RGB components.

Definition at line 902 of file RGBColorSystem.h.

◆ RGBToCIEXYZ()

void pcl::RGBColorSystem::RGBToCIEXYZ ( sample X,
sample Y,
sample Z,
sample  R,
sample  G,
sample  B 
) const
inline

Conversion from the RGB color space to the CIE XYZ color space.

Parameters
[out]X,Y,ZReferences to the variables where output CIE XYZ components will be copied.
R,G,BInput RGB components.

Definition at line 693 of file RGBColorSystem.h.

◆ RGBToCIEXZ()

void pcl::RGBColorSystem::RGBToCIEXZ ( sample X,
sample Z,
sample  R,
sample  G,
sample  B 
) const
inline

Calculates the chrominance components in the CIE XYZ color space corresponding to a specified set of RGB components.

Parameters
[out]X,ZReferences to the variables where output CIE X and Z components will be copied.
R,G,BInput RGB components.

This function avoids the calculation of the CIE Y component, which saves computing time when only the chrominance components are required.

Definition at line 710 of file RGBColorSystem.h.

◆ RGBToGray()

void pcl::RGBColorSystem::RGBToGray ( sample K,
sample  R,
sample  G,
sample  B 
) const
inline

Calculates the lightness component in the CIE L*a*b* space corresponding to a set of RGB components, and copies it to a specified variable K.

Parameters
[out]KReference to an output variable for the calculated lightness component.
R,G,BInput RGB components.

Definition at line 412 of file RGBColorSystem.h.

◆ RGBToHSI()

static void pcl::RGBColorSystem::RGBToHSI ( sample H,
sample S,
sample I,
sample  R,
sample  G,
sample  B 
)
inlinestatic

Converts a set of RGB components to the corresponding channel values in the HSI (Hue, Saturation, Intensity) color ordering system.

Parameters
[out]H,S,IReferences to the variables where output HSI channel values will be copied.
R,G,BInput RGB components.

The output H value is a normalized hue, which is the hue angle rescaled to the normalized [0,1] range. A normalized hue value of one corresponds to a hue angle of 2*pi radians, or 360 degrees.

Note
HSI is more often known as HSL; however we reserve the L channel identifier exclusively for the CIE L* component (lightness) in PCL.
This is a static function provided for convenience; HSV is not a color space, but a color ordering system not based on a RGBWS.

Definition at line 604 of file RGBColorSystem.h.

◆ RGBToHSIL()

void pcl::RGBColorSystem::RGBToHSIL ( sample H,
sample S,
sample I,
sample L,
sample  R,
sample  G,
sample  B 
) const
inline

Converts a set of RGB components to the corresponding channel values in the HSI (Hue, Saturation, Intensity) color ordering system, plus the L* component (lightness) in the CIE L*a*b* space.

Parameters
[out]H,S,IReferences to the variables where output HSI channel values will be copied.
[out]LReference to a variable where the output CIE L* component will be copied.
R,G,BInput RGB components.

The output H value is a normalized hue, which is the hue angle rescaled to the normalized [0,1] range. A normalized hue value of one corresponds to a hue angle of 2*pi radians, or 360 degrees.

Note
HSI is more often known as HSL; however we reserve the L channel identifier exclusively for the CIE L* component (lightness) in PCL.

Definition at line 679 of file RGBColorSystem.h.

◆ RGBToHSV()

static void pcl::RGBColorSystem::RGBToHSV ( sample H,
sample S,
sample V,
sample  R,
sample  G,
sample  B 
)
inlinestatic

Converts a set of RGB components to the corresponding channel values in the HSV (Hue, Saturation, Value) color ordering system.

Parameters
[out]H,S,VReferences to the variables where output HSV channel values will be copied.
R,G,BInput RGB components.

The output H value is a normalized hue, which is the hue angle rescaled to the normalized [0,1] range. A normalized hue value of one corresponds to a hue angle of 2*pi radians, or 360 degrees.

Note
This is a static function provided for convenience; HSV is not a color space, but a color ordering system not based on a RGBWS.

Definition at line 557 of file RGBColorSystem.h.

◆ RGBToHSVL()

void pcl::RGBColorSystem::RGBToHSVL ( sample H,
sample S,
sample V,
sample L,
sample  R,
sample  G,
sample  B 
) const
inline

Converts a set of RGB components to the corresponding channel values in the HSV (Hue, Saturation, Value) color ordering system, plus the L* component (lightness) in the CIE L*a*b* space.

Parameters
[out]H,S,VReferences to the variables where output HSV channel values will be copied.
[out]LReference to a variable where the output CIE L* component will be copied.
R,G,BInput RGB components.

The output H value is a normalized hue, which is the hue angle rescaled to the normalized [0,1] range. A normalized hue value of one corresponds to a hue angle of 2*pi radians, or 360 degrees.

Definition at line 653 of file RGBColorSystem.h.

◆ RGBToXYZMatrix()

const Vector& pcl::RGBColorSystem::RGBToXYZMatrix ( ) const
inline

Returns a reference to a vector with the elements of the immutable 3x3 RGB to CIE XYZ conversion matrix used in this RGB working space.

The RGB->XYZ conversion matrix is a function of the luminance coefficients and chromaticity coordinates that define this RGB color space.

The nine matrix elements are stored contiguously in row order in the returned vector: M[0][0], M[0][1], ..., M[2][2].

Definition at line 285 of file RGBColorSystem.h.

◆ Saturation()

sample pcl::RGBColorSystem::Saturation ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the Saturation channel value in the HSV color ordering system, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.

This function is a synonym for HSVSaturation().

Definition at line 536 of file RGBColorSystem.h.

◆ Value()

sample pcl::RGBColorSystem::Value ( sample  R,
sample  G,
sample  B 
) const
inline

Returns the Value channel value in the HSV color ordering system, corresponding to a specified set of RGB components.

Parameters
R,G,BInput RGB components.
Note
This is an utility function provided for convenience; HSV is not a color space, but a color ordering system not based on a RGBWS.

Definition at line 426 of file RGBColorSystem.h.

References pcl::Max().

◆ XYZToRGBMatrix()

const Vector& pcl::RGBColorSystem::XYZToRGBMatrix ( ) const
inline

Returns a reference to a vector with the elements of the immutable 3x3 CIE XYZ to RGB inverse conversion matrix used in this RGB working space.

The XYZ->RGB inverse conversion matrix is a function of the luminance coefficients and chromaticity coordinates that define this RGB color space.

The nine inverse matrix elements are stored contiguously in row order in the returned vector: M_[0][0], M_[0][1], ..., M_[2][2].

Definition at line 301 of file RGBColorSystem.h.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const RGBColorSystem S1,
const RGBColorSystem S2 
)
friend

Returns true iff two RGBColorSystem instances define the same RGB working space. This happens when either both instances are aliases, or if they define exactly the same RGB space parameters.

Definition at line 344 of file RGBColorSystem.h.

Member Data Documentation

◆ sRGB

const RGBColorSystem pcl::RGBColorSystem::sRGB
static

The sRGB (D50) working space.

Definition at line 1474 of file RGBColorSystem.h.

Referenced by pcl::ImageColor::ResetDefaultRGBWorkingSpace().

◆ sRGB_x

const float pcl::RGBColorSystem::sRGB_x[3]
static

sRGB x chromaticity coordinates (D50).

Definition at line 1459 of file RGBColorSystem.h.

◆ sRGB_y

const float pcl::RGBColorSystem::sRGB_y[3]
static

sRGB y chromaticity coordinates (D50).

Definition at line 1464 of file RGBColorSystem.h.

◆ sRGB_Y

const float pcl::RGBColorSystem::sRGB_Y[3]
static

sRGB luminance coefficients (D50).

Definition at line 1469 of file RGBColorSystem.h.


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