Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::xgl::Color Class Reference

Color class used in vertex arrays and has layout of 4 x GLfloat. More...

#include <Color.h>

Inheritance diagram for sf::xgl::Color:
Collaboration diagram for sf::xgl::Color:

Public Member Functions

 Color ()
 Default constructor initializing with a black color.
 
 Color (const QColor &color)
 Constructor for Qt QColor.
 
 Color (const QColor &color, float alpha)
 Constructor for Qt QColor with a different alpha value.
 
 Color (const Color &color, GLfloat alpha)
 Initializing constructor copying a color but setting a different alpha value.
 
 Color (float r, float g, float b, float a=1.0f)
 Initializing constructor for separate rgba values.
 
 operator const float * () const
 Gets the float pointer and allows omitting a call for the data() method from the base class.
 
 operator float * ()
 Gets the float pointer and allows omitting a call for the data() method from the base class.
 
Color inverted () const
 
bool isZero () const
 Checks if the all values are zero.
 
 operator QColor () const
 Conversion operator when passing this class where a QColor is needed.
 
Coloroperator= (QColor color)
 Assignment operator accepting a QColor instance.
 

Detailed Description

Color class used in vertex arrays and has layout of 4 x GLfloat.

Constructor & Destructor Documentation

◆ Color() [1/5]

sf::xgl::Color::Color ( )

Default constructor initializing with a black color.

◆ Color() [2/5]

sf::xgl::Color::Color ( const QColor &  color)
explicit

Constructor for Qt QColor.

◆ Color() [3/5]

sf::xgl::Color::Color ( const QColor &  color,
float  alpha 
)
explicit

Constructor for Qt QColor with a different alpha value.

◆ Color() [4/5]

sf::xgl::Color::Color ( const Color color,
GLfloat  alpha 
)

Initializing constructor copying a color but setting a different alpha value.

Parameters
colorCopy color.
alphaAlpha transparency value between 0 and 1 where 0 is fully transparent.

◆ Color() [5/5]

sf::xgl::Color::Color ( float  r,
float  g,
float  b,
float  a = 1.0f 
)

Initializing constructor for separate rgba values.

Parameters
rRed value between 0 and 1.
gGreen value between 0 and 1.
bBlue value between 0 and 1.
aAlpha transparency value between 0 and 1 where 0 is fully transparent.

Member Function Documentation

◆ inverted()

Color sf::xgl::Color::inverted ( ) const

Gets the inverted color.

◆ isZero()

bool sf::xgl::Color::isZero ( ) const

Checks if the all values are zero.

Returns
True when zero.

◆ operator const float *()

sf::xgl::Color::operator const float * ( ) const

Gets the float pointer and allows omitting a call for the data() method from the base class.

◆ operator float *()

sf::xgl::Color::operator float * ( )

Gets the float pointer and allows omitting a call for the data() method from the base class.

◆ operator QColor()

sf::xgl::Color::operator QColor ( ) const

Conversion operator when passing this class where a QColor is needed.

◆ operator=()

Color & sf::xgl::Color::operator= ( QColor  color)

Assignment operator accepting a QColor instance.


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