PCL
pcl::RGBColorSystem Class Reference

Colorimetrically defined RGB working color space. More...

#include <RGBColorSystem.h>

Public Types

using sample = double
 

Public Member Functions

 RGBColorSystem ()
 
 RGBColorSystem (const RGBColorSystem &s)
 
 RGBColorSystem (float gamma, bool issRGB, const float *x, const float *y, const float *Y=nullptr)
 
 RGBColorSystem (float gamma, bool issRGB, const FVector &x, const FVector &y, const FVector &Y=FVector())
 
virtual ~RGBColorSystem ()
 
void Assign (const RGBColorSystem &rgbws)
 
const FVectorChromaticityXCoordinates () const
 
const FVectorChromaticityYCoordinates () const
 
sample CIEa (sample R, sample G, sample B) const
 
double CIEaNormalizationFactor () const
 
double CIEaNormalizationOffset () const
 
sample CIEb (sample R, sample G, sample B) const
 
double CIEbNormalizationFactor () const
 
double CIEbNormalizationOffset () const
 
sample CIEc (sample R, sample G, sample B) const
 
double CIEcNormalizationFactor () 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
 
double CIEXNormalizationFactor () 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
 
double CIEZNormalizationFactor () 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 &rgbws)
 
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 double LinearToSRGB (double x)
 
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 double SRGBToLinear (double x)
 

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 RGB working space (RGBWS) implementation. 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 not linked to any particular RGBWS.

Color components and channel values are represented as real scalars using 64-bit 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. All internal transformations to and from native color space component ranges are performed transparently.

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

See also
ImageColor, AbstractImage, GenericImage, ImageVariant

Definition at line 101 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 109 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 (adapted to D50) in current versions of the PixInsight platform.

Definition at line 116 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.

Definition at line 128 of file RGBColorSystem.h.

◆ RGBColorSystem() [3/4]

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

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

Parameters
gammaGamma parameter of the RGB working space. Ignored if issRGB is true.
issRGBIf true, this space uses the sRGB gamma function. If this parameter is false, the space uses a standard raise gamma function with the specified gamma exponent.
x,yVectors of chromaticity coordinates relative to the D50 reference white.
YVector of luminance coefficients relative to D50. If not specified, or if an empty vector is specified, luminance coefficients will be calculated internally from the specified color primaries and the D50 reference white components.

Definition at line 154 of file RGBColorSystem.h.

◆ RGBColorSystem() [4/4]

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

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

Parameters
gammaGamma parameter of the RGB working space. Ignored if issRGB is true.
issRGBIf true, this space uses the sRGB gamma function. If this parameter is false, the space uses a standard raise gamma function with the specified gamma exponent.
x,yArrays of chromaticity coordinates relative to the D50 reference white.
YArray of luminance coefficients relative to D50. If not specified, or if a null pointer is specified, luminance coefficients will be calculated internally from the specified color primaries and the D50 reference white components.

Definition at line 179 of file RGBColorSystem.h.

◆ ~RGBColorSystem()

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

Virtual destructor.

Definition at line 187 of file RGBColorSystem.h.

Member Function Documentation

◆ Assign()

void pcl::RGBColorSystem::Assign ( const RGBColorSystem rgbws)
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 427 of file RGBColorSystem.h.

◆ ChromaticityXCoordinates()

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

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

In the current PixInsight platform, chromaticity coordinates are always relative to the D50 reference white.

Definition at line 380 of file RGBColorSystem.h.

◆ ChromaticityYCoordinates()

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

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

In the current PixInsight platform, chromaticity coordinates are always relative to the D50 reference white.

Definition at line 392 of file RGBColorSystem.h.

◆ CIEa()

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

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

Parameters
R,G,BInput RGB components.

Definition at line 882 of file RGBColorSystem.h.

◆ CIEaNormalizationFactor()

double pcl::RGBColorSystem::CIEaNormalizationFactor ( ) const
inline

Returns the scaling factor applied for normalization of CIE a* components.

Definition at line 341 of file RGBColorSystem.h.

◆ CIEaNormalizationOffset()

double pcl::RGBColorSystem::CIEaNormalizationOffset ( ) const
inline

Returns the additive constant applied for normalization of CIE a* components.

Definition at line 332 of file RGBColorSystem.h.

◆ CIEb()

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

Returns the normalized b* chrominance component of 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* components, which saves time when only the b* chrominance component is required.

Definition at line 899 of file RGBColorSystem.h.

◆ CIEbNormalizationFactor()

double pcl::RGBColorSystem::CIEbNormalizationFactor ( ) const
inline

Returns the scaling factor applied for normalization of CIE b* components.

Definition at line 359 of file RGBColorSystem.h.

◆ CIEbNormalizationOffset()

double pcl::RGBColorSystem::CIEbNormalizationOffset ( ) const
inline

Returns the additive constant applied for normalization of CIE b* components.

Definition at line 350 of file RGBColorSystem.h.

◆ CIEc()

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

Returns the normalized c* chrominance component of 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* components, which saves time when only the c* chrominance component is required.

Definition at line 916 of file RGBColorSystem.h.

◆ CIEcNormalizationFactor()

double pcl::RGBColorSystem::CIEcNormalizationFactor ( ) const
inline

Returns the scaling factor applied for normalization of CIE c* components.

Definition at line 368 of file RGBColorSystem.h.

◆ CIEh()

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

Returns the normalized h* chrominance component of 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* components, which saves 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 939 of file RGBColorSystem.h.

◆ CIEhr()

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

Returns the normalized h* chrominance component of 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 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 956 of file RGBColorSystem.h.

◆ CIEL()

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

A synonym for Lightness().

Definition at line 468 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 CIE L*a*b* to CIE L*c*h*.

Parameters
[out]L,c,hReferences to the variables where output normalized CIE L*c*h* components will be stored.
L0,a,bInput normalized 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 1249 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 CIE L*a*b* to CIE XYZ.

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

Definition at line 1226 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 CIE L*a*b* to RGB.

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

Definition at line 1209 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 CIE L*c*h* to CIE L*a*b*.

Parameters
[out]L,a,bReferences to the variables where output normalized CIE L*a*b* components will be stored.
L0,c,hInput normalized 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 1294 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 CIE L*c*h* to RGB.

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

Definition at line 1268 of file RGBColorSystem.h.

◆ CIELToCIEY()

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

CIE Y component from CIE L*.

Parameters
LInput CIE L* component.

Definition at line 833 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 792 of file RGBColorSystem.h.

◆ CIEXNormalizationFactor()

double pcl::RGBColorSystem::CIEXNormalizationFactor ( ) const
inline

Returns the scaling factor applied for normalization of CIE X components.

This normalization factor is the sum of the elements in the first row of the XYZ-to-RGB conversion matrix: M[0][0] + M[0][1] + M[0][2].

Normalization applies linear transformations to ensure that the values of all color space components are always represented in the [0,1] range, irrespective of RGBWS parameters.

Definition at line 308 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 CIE XYZ to CIE L*a*b*.

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

Definition at line 1193 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 CIE XYZ to RGB.

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

Definition at line 1180 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 802 of file RGBColorSystem.h.

◆ CIEYToCIEL()

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

CIE L* component from CIE Y.

Parameters
YInput CIE Y component.

Definition at line 822 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 812 of file RGBColorSystem.h.

◆ CIEZNormalizationFactor()

double pcl::RGBColorSystem::CIEZNormalizationFactor ( ) const
inline

Returns the scaling factor applied for normalization of CIE Z components.

This normalization factor is the sum of the elements in the third row of the XYZ-to-RGB conversion matrix: M[2][0] + M[2][1] + M[2][2].

Normalization applies linear transformations to ensure that the values of all color space components are always represented in the [0,1] range, irrespective of RGBWS parameters.

Definition at line 323 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 decrements the reference counter of the original data.

Definition at line 225 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 power-law gamma function. sRGB defines a special, piecewise component delinearization function; see the references for detailed information.

Definition at line 243 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 normalized CIE L* components to the RGB color space.

Parameters
[out]R,G,BReferences to the variables where output normalized RGB components will be stored.
H,S,IInput HSI channel values for chrominance.
LInput normalized 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 and hence is not defined in an RGB working space. However, the chrominance is supposed to be expressed in the RGB working space referenced by this RGBColorSystem object.

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 complete preservation of the colorimetrically defined lightness component.

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

Definition at line 1161 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 utility function is provided for convenience; HSI is not a color space, but a color ordering system not based on an RGBWS.

Definition at line 587 of file RGBColorSystem.h.

◆ 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 normalized RGB components will be stored.
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 identifier exclusively for the CIE L* component (lightness) in PCL.
This utility function is provided for convenience; HSI is not a color space, but a color ordering system not based on an RGBWS.

Definition at line 1116 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

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

Parameters
[out]R,G,BReferences to the variables where output normalized RGB components will be stored.
H,S,VInput HSV channel values for chrominance.
LInput normalized 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 and hence is not defined in an RGB working space. However, the chrominance is supposed to be expressed in the RGB working space referenced by this RGBColorSystem object.

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 complete preservation of the colorimetrically defined lightness component.

Definition at line 1087 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 utility function is provided for convenience; HSV is not a color space but a color ordering system not based on an RGBWS.

Definition at line 568 of file RGBColorSystem.h.

◆ 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 normalized RGB components will be stored.
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 utility function is provided for convenience; HSV is not a color space, but a color ordering system not based on an RGBWS.

Definition at line 1032 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 utility function is provided for convenience; HSV and HSI are not color spaces, but color ordering systems not based on an RGBWS.

Definition at line 534 of file RGBColorSystem.h.

◆ 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 utility function is provided for convenience; HSI is not a color space, but a color ordering system not based on an RGBWS.

Definition at line 515 of file RGBColorSystem.h.

◆ 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 212 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 261 of file RGBColorSystem.h.

◆ IsSRGB()

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

Returns true iff this space uses a sRGB gamma function.

Definition at line 251 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 200 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 RGB components.

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

Definition at line 453 of file RGBColorSystem.h.

◆ LinearToSRGB()

static double pcl::RGBColorSystem::LinearToSRGB ( double  x)
inlinestatic

The inverse sRGB gamma function. Returns a color sample value in the sRGB color space for the specified linear sample value x. x must be in the normalized [0,1] range.

Definition at line 1319 of file RGBColorSystem.h.

References pcl::Pow().

◆ LuminanceCoefficients()

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

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

In the current PixInsight platform, luminance coefficients are always relative to the D50 reference white.

Definition at line 404 of file RGBColorSystem.h.

◆ operator=()

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

Assignment iterator. Returns a reference to this object.

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

Definition at line 439 of file RGBColorSystem.h.

◆ RGBToCIEab()

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

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

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

Definition at line 867 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 RGB to the CIE L*a*b* color space.

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

Definition at line 848 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 normalized CIE L*a*b* components will be stored.
[out]cReference to a variable where the output normalized CIE c* component will be stored.
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 1006 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 normalized CIE L*c*h* components will be stored.
R,G,BInput RGB components.

Definition at line 975 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 stored.
R,G,BInput RGB components.

Definition at line 765 of file RGBColorSystem.h.

◆ RGBToCIEXZ()

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

Calculates the chrominance X, Z 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 stored.
R,G,BInput RGB components.

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

Definition at line 782 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 variable.

Parameters
[out]KReference to an output variable for the calculated lightness component.
R,G,BInput RGB components.
See also
Lightness(), CIEL()

Definition at line 484 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 stored.
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 identifier exclusively for the CIE L* component (lightness) in PCL.
This utility function is provided for convenience; HSV is not a color space, but a color ordering system not based on an RGBWS.

Definition at line 676 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 stored.
[out]LReference to a variable where the output CIE L* component will be stored.
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 identifier exclusively for the CIE L* component (lightness) in PCL.

Definition at line 751 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 stored.
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 utility function is provided for convenience; HSV is not a color space, but a color ordering system not based on an RGBWS.

Definition at line 629 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 stored.
[out]LReference to a variable where the output CIE L* component will be stored.
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 725 of file RGBColorSystem.h.

◆ RGBToXYZMatrix()

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

Returns a reference to a vector with the elements of the 3x3 matrix for conversion from RGB to CIE XYZ color spaces.

The RGB-to-XYZ conversion matrix is a function of the reference white (always D50 in this implementation) and the chromaticity coordinates that define this RGB working 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 277 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 608 of file RGBColorSystem.h.

◆ SRGBToLinear()

static double pcl::RGBColorSystem::SRGBToLinear ( double  x)
inlinestatic

The sRGB gamma function. Returns a linear color sample value for the specified sample value x in the sRGB color space. x must be in the normalized [0,1] range.

Definition at line 1308 of file RGBColorSystem.h.

References pcl::Pow().

◆ 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 utility function is provided for convenience; HSV is not a color space, but a color ordering system not based on an RGBWS.

Definition at line 498 of file RGBColorSystem.h.

◆ XYZToRGBMatrix()

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

Returns a reference to a vector with the elements of the 3x3 inverse matrix for conversion from CIE XYZ to RGB color spaces.

The XYZ-to-RGB inverse conversion matrix is a function of the reference white (always D50 in this implementation) and the chromaticity coordinates that define this RGB working 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 293 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 414 of file RGBColorSystem.h.

Member Data Documentation

◆ sRGB

const RGBColorSystem pcl::RGBColorSystem::sRGB
static

The sRGB (D50) working space.

Definition at line 1579 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 1564 of file RGBColorSystem.h.

◆ sRGB_y

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

sRGB y chromaticity coordinates (D50).

Definition at line 1569 of file RGBColorSystem.h.

◆ sRGB_Y

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

sRGB luminance coefficients (D50).

Definition at line 1574 of file RGBColorSystem.h.


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