PCL
RGBA Color Utility Functions

Typedefs

using pcl::RGBA = uint32
 

Functions

uint8 pcl::Alpha (RGBA rgba)
 
uint8 pcl::Blue (RGBA rgba)
 
void pcl::ClearAlpha (RGBA &rgba)
 
void pcl::ClearBlue (RGBA &rgba)
 
void pcl::ClearGreen (RGBA &rgba)
 
void pcl::ClearRed (RGBA &rgba)
 
IsoString PCL_FUNC pcl::CSSColorName (RGBA)
 
uint8 pcl::Green (RGBA rgba)
 
uint8 pcl::Red (RGBA rgba)
 
RGBA PCL_FUNC pcl::RGBAColor (const IsoString &colorNameOrHex)
 
RGBA pcl::RGBAColor (double r, double g, double b)
 
RGBA pcl::RGBAColor (double r, double g, double b, double a)
 
RGBA pcl::RGBAColor (float r, float g, float b)
 
RGBA pcl::RGBAColor (float r, float g, float b, float a)
 
RGBA pcl::RGBAColor (int r, int g, int b)
 
RGBA pcl::RGBAColor (int r, int g, int b, int a)
 
IsoString pcl::RGBAColorToHexString (RGBA c)
 
IsoString pcl::RGBColorToHexString (RGBA c)
 
void pcl::SetAlpha (RGBA &rgba, uint8 a)
 
void pcl::SetBlue (RGBA &rgba, uint8 b)
 
void pcl::SetGreen (RGBA &rgba, uint8 g)
 
void pcl::SetRed (RGBA &rgba, uint8 r)
 
RGBA pcl::StringToRGBAColor (const IsoString &colorNameOrHex)
 

Detailed Description

Typedef Documentation

◆ RGBA

using pcl::RGBA = typedef uint32

Defines a 32-bit RGBA pixel value.

A RGBA pixel value is encoded as follows:

AARRGGBB

where each letter represents a 4-bit hexadecimal digit (from 0 to F). Each 8-bit pair represents a pixel component in the range from 0 to 255:

AA Alpha value, or pixel transparency: 0 means completely transparent, 255 corresponds to an opaque pixel.
RR Red pixel color component.
GG Green pixel color component.
BB Blue pixel color component.

Definition at line 92 of file Color.h.

Function Documentation

◆ Alpha()

uint8 pcl::Alpha ( RGBA  rgba)
inline

Returns the alpha (transparency) component of an RGBA pixel value.

Definition at line 99 of file Color.h.

Referenced by pcl::RGBAColorToHexString().

◆ Blue()

uint8 pcl::Blue ( RGBA  rgba)
inline

Returns the blue color component of an RGBA pixel value.

Definition at line 129 of file Color.h.

Referenced by pcl::RGBAColorToHexString(), and pcl::RGBColorToHexString().

◆ ClearAlpha()

void pcl::ClearAlpha ( RGBA rgba)
inline

Clears (sets to zero) the alpha (transparency) component of an RGBA pixel value.

Definition at line 140 of file Color.h.

◆ ClearBlue()

void pcl::ClearBlue ( RGBA rgba)
inline

Clears (sets to zero) the blue color component of an RGBA pixel value.

Definition at line 170 of file Color.h.

◆ ClearGreen()

void pcl::ClearGreen ( RGBA rgba)
inline

Clears (sets to zero) the green color component of an RGBA pixel value.

Definition at line 160 of file Color.h.

Referenced by pcl::SetGreen().

◆ ClearRed()

void pcl::ClearRed ( RGBA rgba)
inline

Clears (sets to zero) the red color component of an RGBA pixel value.

Definition at line 150 of file Color.h.

Referenced by pcl::SetRed().

◆ CSSColorName()

IsoString PCL_FUNC pcl::CSSColorName ( RGBA  )

Returns the CSS color name corresponding to an RGBA pixel value.

The alpha component is ignored, except for the special value 0x00000000, which is returned as "Transparent". If the value does not have a CSS named color counterpart, this function returns an empty string.

◆ Green()

uint8 pcl::Green ( RGBA  rgba)
inline

Returns the green color component of an RGBA pixel value.

Definition at line 119 of file Color.h.

Referenced by pcl::RGBAColorToHexString(), and pcl::RGBColorToHexString().

◆ Red()

uint8 pcl::Red ( RGBA  rgba)
inline

Returns the red color component of an RGBA pixel value.

Definition at line 109 of file Color.h.

Referenced by pcl::RGBAColorToHexString(), and pcl::RGBColorToHexString().

◆ RGBAColor() [1/7]

RGBA PCL_FUNC pcl::RGBAColor ( const IsoString colorNameOrHex)

Returns an RGBA pixel value corresponding to a CSS color specification string.

The string can be an hex-encoded color value in one of two valid formats:

"#RRGGBB" "#RRGGBBAA"

or a valid CSS color name like "white", "black", "red", "orange", and so on.

CSS color names are case-insensitive, and are returned with their alpha components equal to 0xFF (opaque), except "transparent", which is returned as 0x00000000 (also known as "transparent black").

If the string cannot be converted to a valid color value, this function silently ignores the error and returns zero.

◆ RGBAColor() [2/7]

RGBA pcl::RGBAColor ( double  r,
double  g,
double  b 
)
inline

Returns an opaque RGBA pixel value for the specified separate color component real values.

Parameters
rRed color component
gGreen color component
bBlue color component

All components must be in the normalized range [0,1]. The returned RGBA value has its alpha component equal to 255 (opaque).

Definition at line 300 of file Color.h.

◆ RGBAColor() [3/7]

RGBA pcl::RGBAColor ( double  r,
double  g,
double  b,
double  a 
)
inline

Returns an RGBA pixel value for the specified separate alpha and color component real values.

Parameters
rRed color component
gGreen color component
bBlue color component
aAlpha (transparency)

All components must be in the normalized range [0,1].

Definition at line 264 of file Color.h.

◆ RGBAColor() [4/7]

RGBA pcl::RGBAColor ( float  r,
float  g,
float  b 
)
inline

Returns an opaque RGBA pixel value for the specified separate color component real values.

Parameters
rRed color component
gGreen color component
bBlue color component

All components must be in the normalized range [0,1]. The returned RGBA value has its alpha component equal to 255 (opaque).

Definition at line 318 of file Color.h.

◆ RGBAColor() [5/7]

RGBA pcl::RGBAColor ( float  r,
float  g,
float  b,
float  a 
)
inline

Returns an RGBA pixel value for the specified separate alpha and color component real values.

Parameters
rRed color component
gGreen color component
bBlue color component
aAlpha (transparency)

All components must be in the normalized range [0,1].

Definition at line 282 of file Color.h.

◆ RGBAColor() [6/7]

RGBA pcl::RGBAColor ( int  r,
int  g,
int  b 
)
inline

Returns an opaque RGBA pixel value for the specified separate color component integer values.

Parameters
rRed color component
gGreen color component
bBlue color component

All components must be in the range [0,255]. The returned RGBA value has its alpha component equal to 255 (opaque).

Definition at line 246 of file Color.h.

◆ RGBAColor() [7/7]

RGBA pcl::RGBAColor ( int  r,
int  g,
int  b,
int  a 
)
inline

Returns an RGBA pixel value for the specified separate alpha and color component integer values.

Parameters
rRed color component
gGreen color component
bBlue color component
aAlpha (transparency)

All components must be in the range [0,255].

Definition at line 228 of file Color.h.

Referenced by pcl::StringToRGBAColor().

◆ RGBAColorToHexString()

IsoString pcl::RGBAColorToHexString ( RGBA  c)
inline

Returns an hex-encoded string representation of an RGBA pixel value.

The returned string has the format "#RRGGBBAA".

Definition at line 387 of file Color.h.

References pcl::Alpha(), pcl::Blue(), pcl::IsoString::Format(), pcl::Green(), and pcl::Red().

◆ RGBColorToHexString()

IsoString pcl::RGBColorToHexString ( RGBA  c)
inline

Returns an hex-encoded string representation of an RGBA pixel value, ignoring the alpha component.

The returned string has the format "#RRGGBB".

Definition at line 373 of file Color.h.

References pcl::Blue(), pcl::IsoString::Format(), pcl::Green(), and pcl::Red().

◆ SetAlpha()

void pcl::SetAlpha ( RGBA rgba,
uint8  a 
)
inline

Sets the alpha (transparency) component of an RGBA pixel value.

Definition at line 180 of file Color.h.

Referenced by pcl::Bitmap::SetAlpha().

◆ SetBlue()

void pcl::SetBlue ( RGBA rgba,
uint8  b 
)
inline

Sets the blue color component of an RGBA pixel value.

Definition at line 210 of file Color.h.

◆ SetGreen()

void pcl::SetGreen ( RGBA rgba,
uint8  g 
)
inline

Sets the green color component of an RGBA pixel value.

Definition at line 200 of file Color.h.

References pcl::ClearGreen().

◆ SetRed()

void pcl::SetRed ( RGBA rgba,
uint8  r 
)
inline

Sets the red color component of an RGBA pixel value.

Definition at line 190 of file Color.h.

References pcl::ClearRed().

◆ StringToRGBAColor()

RGBA pcl::StringToRGBAColor ( const IsoString colorNameOrHex)
inline

An alias to RGBAColor( const IsoString& ).

Definition at line 355 of file Color.h.

References pcl::RGBAColor().