Castor3D 0.16.0
Multiplatform 3D engine
|
RGB colour representation. More...
#include <RgbColour.hpp>
Public Member Functions | |
RgbColourT ()=default | |
RgbColourT (RgbColourT const &rhs)=default | |
RgbColourT & | operator= (RgbColourT const &rhs)=default |
RgbColourT (RgbColourT &&rhs) noexcept=default | |
RgbColourT & | operator= (RgbColourT &&rhs) noexcept=default |
~RgbColourT () noexcept=default | |
template<typename ComponentU > | |
RgbColourT (RgbColourT< ComponentU > const &rhs, float gamma=2.2f) | |
Constructor from other component type. | |
RgbColourT (float r, float g, float b) | |
Specified Constructor. | |
ColourComponentArrayIt | begin () |
Retrieves an iterator to the first ColourComponent. | |
ColourComponentArrayConstIt | begin () const |
Retrieves a constant iterator to the first ColourComponent. | |
ColourComponentArrayIt | end () |
Retrieves an iterator to beyond the last ColourComponent. | |
ColourComponentArrayConstIt | end () const |
Retrieves a constant iterator to beyond the last ColourComponent. | |
float const * | constPtr () const |
Retrieves a constant pointer to the colour values. | |
float * | ptr () |
Retrieves a pointer to the colour values. | |
ComponentType & | operator[] (RgbComponent component) |
Retrieves the asked component value. | |
ComponentType const & | operator[] (RgbComponent component) const |
Retrieves the asked component value. | |
ComponentType & | operator[] (size_t component) |
Retrieves the asked component value. | |
ComponentType const & | operator[] (size_t component) const |
Retrieves the asked component value. | |
ComponentType & | get (RgbComponent component) |
Retrieves the asked component value. | |
ComponentType const & | get (RgbComponent component) const |
Retrieves the asked component value. | |
ComponentType & | red () |
Retrieves the red component value. | |
ComponentType const & | red () const |
Retrieves the red component value. | |
ComponentType & | green () |
Retrieves the green component value. | |
ComponentType const & | green () const |
Retrieves the green component value. | |
ComponentType & | blue () |
Retrieves the blue component value. | |
ComponentType const & | blue () const |
Retrieves the blue component value. | |
RgbColourT & | operator+= (RgbColourT const &rhs) |
addition assignment operator | |
RgbColourT & | operator-= (RgbColourT const &rhs) |
Substraction assignment operator. | |
template<typename T > | |
RgbColourT & | operator+= (T scalar) |
addition assignment operator | |
template<typename T > | |
RgbColourT & | operator-= (T scalar) |
Substraction assignment operator. | |
template<typename T > | |
RgbColourT & | operator*= (T scalar) |
Multiplication assignment operator. | |
template<typename T > | |
RgbColourT & | operator/= (T scalar) |
Division assignment operator. | |
RgbColourT & | operator+= (ComponentType const &component) |
addition assignment operator | |
RgbColourT & | operator-= (ComponentType const &component) |
Substraction assignment operator. | |
RgbColourT & | operator*= (ComponentType const &component) |
Multiplication assignment operator. | |
RgbColourT & | operator/= (ComponentType const &component) |
Division assignment operator. | |
Static Public Member Functions | |
template<typename T1 , typename T2 , typename T3 > | |
static RgbColourT | fromComponents (T1 const &r, T2 const &g, T3 const &b) |
Constructor from components. | |
static RgbColourT | fromPredefined (PredefinedRgbColour predefined) |
Constructor from a predefined colour. | |
static RgbColourT | fromRGB (Point3ub const &colour) |
Constructor from a point representing RGB components. | |
static RgbColourT | fromBGR (Point3ub const &colour) |
Constructor from a point representing BGR components. | |
static RgbColourT | fromRGBA (Point4ub const &colour) |
Constructor from a point representing RGBA components. | |
static RgbColourT | fromBGRA (Point4ub const &colour) |
Constructor from a point representing BGRA components. | |
static RgbColourT | fromARGB (Point4ub const &colour) |
Constructor from a point representing ARGB components. | |
static RgbColourT | fromABGR (Point4ub const &colour) |
Constructor from a point representing ABGR components. | |
static RgbColourT | fromRGB (Point3f const &colour) |
Constructor from a point representing RGB components. | |
static RgbColourT | fromBGR (Point3f const &colour) |
Constructor from a point representing BGR components. | |
static RgbColourT | fromRGBA (Point4f const &colour) |
Constructor from a point representing RGBA components. | |
static RgbColourT | fromARGB (Point4f const &colour) |
Constructor from a point representing ARGB components. | |
static RgbColourT | fromABGR (Point4f const &colour) |
Constructor from a point representing ABGR components. | |
static RgbColourT | fromBGRA (Point4f const &colour) |
Constructor from a point representing BGRA components. | |
static RgbColourT | fromRGB (uint8_t const(&colour)[3]) |
Constructor from a point representing RGB components. | |
static RgbColourT | fromBGR (uint8_t const(&colour)[3]) |
Constructor from a point representing BGR components. | |
static RgbColourT | fromRGBA (uint8_t const(&colour)[4]) |
Constructor from a point representing RGBA components. | |
static RgbColourT | fromBGRA (uint8_t const(&colour)[4]) |
Constructor from a point representing BGRA components. | |
static RgbColourT | fromARGB (uint8_t const(&colour)[4]) |
Constructor from a point representing ARGB components. | |
static RgbColourT | fromABGR (uint8_t const(&colour)[4]) |
Constructor from a point representing ABGR components. | |
static RgbColourT | fromRGB (float const(&colour)[3]) |
Constructor from a point representing RGB components. | |
static RgbColourT | fromBGR (float const(&colour)[3]) |
Constructor from a point representing BGR components. | |
static RgbColourT | fromRGBA (float const(&colour)[4]) |
Constructor from a point representing RGBA components. | |
static RgbColourT | fromARGB (float const(&colour)[4]) |
Constructor from a point representing ARGB components. | |
static RgbColourT | fromABGR (float const(&colour)[4]) |
Constructor from a point representing ABGR components. | |
static RgbColourT | fromBGRA (float const(&colour)[4]) |
Constructor from a point representing BGRA components. | |
static RgbColourT | fromRGB (uint32_t colour) |
Constructor from an uint32_t representing RGB components. | |
static RgbColourT | fromBGR (uint32_t colour) |
Constructor from an uint32_t representing BGR components. | |
static RgbColourT | fromARGB (uint32_t colour) |
Constructor from an uint32_t representing ARGB components. | |
static RgbColourT | fromRGBA (uint32_t colour) |
Constructor from an uint32_t representing RGBA components. | |
static RgbColourT | fromABGR (uint32_t colour) |
Constructor from an uint32_t representing ABGR components. | |
static RgbColourT | fromBGRA (uint32_t colour) |
Constructor from an uint32_t representing BGRA components. | |
static RgbColourT | fromHSB (float hue, float saturation, float brightness) |
Constructor from an HSB components. | |
Friends | |
template<typename ComponentU > | |
class | RgbColourT |
RGB colour representation.
|
default |
|
default |
|
defaultnoexcept |
|
defaultnoexcept |
|
explicit |
Constructor from other component type.
[in] | rhs | The colour value. |
[in] | gamma | The gamma correction value. |
castor::RgbColourT< ComponentType >::RgbColourT | ( | float | r, |
float | g, | ||
float | b ) |
Specified Constructor.
|
inline |
Retrieves an iterator to the first ColourComponent.
|
inline |
Retrieves a constant iterator to the first ColourComponent.
|
inline |
Retrieves the blue component value.
References castor::eBlue, and castor::RgbColourT< ComponentType >::get().
Referenced by castor3d::ControlStyle::doCreateMaterial().
|
inline |
Retrieves the blue component value.
References castor::eBlue, and castor::RgbColourT< ComponentType >::get().
|
inline |
Retrieves a constant pointer to the colour values.
Referenced by castor3d::getBuffer().
|
inline |
Retrieves an iterator to beyond the last ColourComponent.
|
inline |
Retrieves a constant iterator to beyond the last ColourComponent.
|
static |
Constructor from a point representing ABGR components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing ABGR components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing ABGR components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from an uint32_t representing ABGR components.
[in] | colour | The uint32_t containing the colour (0xAABBGGRR) |
|
static |
Constructor from a point representing ABGR components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing ARGB components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing ARGB components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing ARGB components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from an uint32_t representing ARGB components.
[in] | colour | The uint32_t containing the colour (0xAARRGGBB) |
|
static |
Constructor from a point representing ARGB components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing BGR components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing BGR components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing BGR components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from an uint32_t representing BGR components.
[in] | colour | The uint32_t containing the colour (0x00BBGGRR) |
|
static |
Constructor from a point representing BGR components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing BGRA components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing BGRA components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing BGRA components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from an uint32_t representing BGRA components.
[in] | colour | The uint32_t containing the colour (0xBBGGRRAA) |
|
static |
Constructor from a point representing BGRA components.
[in] | colour | The point containing the colour components |
|
inlinestatic |
Constructor from components.
[in] | r,g,b | The colour components |
References castor::eBlue, castor::eGreen, and castor::eRed.
|
static |
Constructor from an HSB components.
[in] | hue,saturation,brightness | The HSB components. |
|
inlinestatic |
Constructor from a predefined colour.
[in] | predefined |
References castor::RgbColourT< ComponentType >::fromRGBA().
|
static |
Constructor from a point representing RGB components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing RGB components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing RGB components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from an uint32_t representing RGB components.
[in] | colour | The uint32_t containing the colour (0x00RRGGBB) |
|
static |
Constructor from a point representing RGB components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing RGBA components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing RGBA components.
[in] | colour | The point containing the colour components |
|
static |
Constructor from a point representing RGBA components.
[in] | colour | The point containing the colour components |
Referenced by castor::RgbColourT< ComponentType >::fromPredefined().
|
static |
Constructor from an uint32_t representing RGBA components.
[in] | colour | The uint32_t containing the colour (0xRRGGBBAA) |
|
static |
Constructor from a point representing RGBA components.
[in] | colour | The point containing the colour components |
|
inline |
Retrieves the asked component value.
[in] | component | The asked component |
Referenced by castor::RgbColourT< ComponentType >::blue(), castor::RgbColourT< ComponentType >::blue(), castor::RgbColourT< ComponentType >::green(), castor::RgbColourT< ComponentType >::green(), castor::RgbColourT< ComponentType >::red(), and castor::RgbColourT< ComponentType >::red().
|
inline |
Retrieves the asked component value.
[in] | component | The asked component |
|
inline |
Retrieves the green component value.
References castor::eGreen, and castor::RgbColourT< ComponentType >::get().
Referenced by castor3d::ControlStyle::doCreateMaterial().
|
inline |
Retrieves the green component value.
References castor::eGreen, and castor::RgbColourT< ComponentType >::get().
RgbColourT & castor::RgbColourT< ComponentType >::operator*= | ( | ComponentType const & | component | ) |
Multiplication assignment operator.
[in] | component | The value to multiply |
|
inline |
Multiplication assignment operator.
[in] | scalar | The value to multiply |
References castor::eCount.
RgbColourT & castor::RgbColourT< ComponentType >::operator+= | ( | ComponentType const & | component | ) |
addition assignment operator
[in] | component | The value to add |
RgbColourT & castor::RgbColourT< ComponentType >::operator+= | ( | RgbColourT< ComponentType > const & | rhs | ) |
addition assignment operator
[in] | rhs | The colours to add |
|
inline |
addition assignment operator
[in] | scalar | The value to add |
References castor::eCount.
RgbColourT & castor::RgbColourT< ComponentType >::operator-= | ( | ComponentType const & | component | ) |
Substraction assignment operator.
[in] | component | The value to subtract |
RgbColourT & castor::RgbColourT< ComponentType >::operator-= | ( | RgbColourT< ComponentType > const & | rhs | ) |
Substraction assignment operator.
[in] | rhs | The colours to subtract |
|
inline |
Substraction assignment operator.
[in] | scalar | The value to subtract |
References castor::eCount.
RgbColourT & castor::RgbColourT< ComponentType >::operator/= | ( | ComponentType const & | component | ) |
Division assignment operator.
[in] | component | The value to divide |
|
inline |
Division assignment operator.
[in] | scalar | The value to divide |
References castor::eCount.
|
defaultnoexcept |
|
default |
|
inline |
Retrieves the asked component value.
[in] | component | The asked component |
|
inline |
Retrieves the asked component value.
[in] | component | The asked component |
|
inline |
Retrieves the asked component value.
[in] | component | The asked component |
|
inline |
Retrieves the asked component value.
[in] | component | The asked component |
|
inline |
Retrieves a pointer to the colour values.
Referenced by castor3d::getBuffer().
|
inline |
Retrieves the red component value.
References castor::eRed, and castor::RgbColourT< ComponentType >::get().
Referenced by castor3d::ControlStyle::doCreateMaterial().
|
inline |
Retrieves the red component value.
References castor::eRed, and castor::RgbColourT< ComponentType >::get().