Castor3D 0.16.0
Multiplatform 3D engine
|
RGBA colour representation. More...
#include <RgbaColour.hpp>
Public Member Functions | |
RgbaColourT ()=default | |
RgbaColourT (RgbaColourT const &rhs)=default | |
RgbaColourT & | operator= (RgbaColourT const &rhs)=default |
RgbaColourT (RgbaColourT &&rhs) noexcept=default | |
RgbaColourT & | operator= (RgbaColourT &&rhs) noexcept=default |
~RgbaColourT () noexcept=default | |
template<typename ComponentU > | |
RgbaColourT (RgbaColourT< ComponentU > const &rhs, float gamma=2.2f) | |
Constructor from other component type. | |
RgbaColourT (float r, float g, float b, float a) | |
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[] (RgbaComponent component) |
Retrieves the asked component value. | |
ComponentType const & | operator[] (RgbaComponent 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 (RgbaComponent component) |
Retrieves the asked component value. | |
ComponentType const & | get (RgbaComponent 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. | |
ComponentType & | alpha () |
Retrieves the alpha component value. | |
ComponentType const & | alpha () const |
Retrieves the alpha component value. | |
RgbaColourT & | operator+= (RgbaColourT const &rhs) |
addition assignment operator | |
RgbaColourT & | operator-= (RgbaColourT const &rhs) |
Substraction assignment operator. | |
template<typename T > | |
RgbaColourT & | operator+= (T scalar) |
addition assignment operator | |
template<typename T > | |
RgbaColourT & | operator-= (T scalar) |
Substraction assignment operator. | |
template<typename T > | |
RgbaColourT & | operator*= (T scalar) |
Multiplication assignment operator. | |
template<typename T > | |
RgbaColourT & | operator/= (T scalar) |
Division assignment operator. | |
RgbaColourT & | operator+= (ComponentType const &component) |
addition assignment operator | |
RgbaColourT & | operator-= (ComponentType const &component) |
Substraction assignment operator. | |
RgbaColourT & | operator*= (ComponentType const &component) |
Multiplication assignment operator. | |
RgbaColourT & | operator/= (ComponentType const &component) |
Division assignment operator. | |
Static Public Member Functions | |
template<typename T1 , typename T2 , typename T3 , typename T4 > | |
static RgbaColourT | fromComponents (T1 const &r, T2 const &g, T3 const &b, T4 const &a) |
Constructor from components. | |
static RgbaColourT | fromPredefined (PredefinedRgbaColour predefined) |
Constructor from a predefined colour. | |
static RgbaColourT | fromRGB (Point3ub const &colour) |
Constructor from a point representing RGB components. | |
static RgbaColourT | fromBGR (Point3ub const &colour) |
Constructor from a point representing BGR components. | |
static RgbaColourT | fromRGBA (Point4ub const &colour) |
Constructor from a point representing RGBA components. | |
static RgbaColourT | fromBGRA (Point4ub const &colour) |
Constructor from a point representing BGRA components. | |
static RgbaColourT | fromARGB (Point4ub const &colour) |
Constructor from a point representing ARGB components. | |
static RgbaColourT | fromABGR (Point4ub const &colour) |
Constructor from a point representing ABGR components. | |
static RgbaColourT | fromRGB (Point3f const &colour) |
Constructor from a point representing RGB components. | |
static RgbaColourT | fromBGR (Point3f const &colour) |
Constructor from a point representing BGR components. | |
static RgbaColourT | fromRGBA (Point4f const &colour) |
Constructor from a point representing RGBA components. | |
static RgbaColourT | fromARGB (Point4f const &colour) |
Constructor from a point representing ARGB components. | |
static RgbaColourT | fromABGR (Point4f const &colour) |
Constructor from a point representing ABGR components. | |
static RgbaColourT | fromBGRA (Point4f const &colour) |
Constructor from a point representing BGRA components. | |
static RgbaColourT | fromRGB (uint8_t const(&colour)[3]) |
Constructor from a point representing RGB components. | |
static RgbaColourT | fromBGR (uint8_t const(&colour)[3]) |
Constructor from a point representing BGR components. | |
static RgbaColourT | fromRGBA (uint8_t const(&colour)[4]) |
Constructor from a point representing RGBA components. | |
static RgbaColourT | fromBGRA (uint8_t const(&colour)[4]) |
Constructor from a point representing BGRA components. | |
static RgbaColourT | fromARGB (uint8_t const(&colour)[4]) |
Constructor from a point representing ARGB components. | |
static RgbaColourT | fromABGR (uint8_t const(&colour)[4]) |
Constructor from a point representing ABGR components. | |
static RgbaColourT | fromRGB (float const(&colour)[3]) |
Constructor from a point representing RGB components. | |
static RgbaColourT | fromBGR (float const(&colour)[3]) |
Constructor from a point representing BGR components. | |
static RgbaColourT | fromRGBA (float const(&colour)[4]) |
Constructor from a point representing RGBA components. | |
static RgbaColourT | fromARGB (float const(&colour)[4]) |
Constructor from a point representing ARGB components. | |
static RgbaColourT | fromABGR (float const(&colour)[4]) |
Constructor from a point representing ABGR components. | |
static RgbaColourT | fromBGRA (float const(&colour)[4]) |
Constructor from a point representing BGRA components. | |
static RgbaColourT | fromRGB (uint32_t colour) |
Constructor from an uint32_t representing RGB components. | |
static RgbaColourT | fromBGR (uint32_t colour) |
Constructor from an uint32_t representing BGR components. | |
static RgbaColourT | fromARGB (uint32_t colour) |
Constructor from an uint32_t representing ARGB components. | |
static RgbaColourT | fromRGBA (uint32_t colour) |
Constructor from an uint32_t representing RGBA components. | |
static RgbaColourT | fromABGR (uint32_t colour) |
Constructor from an uint32_t representing ABGR components. | |
static RgbaColourT | fromBGRA (uint32_t colour) |
Constructor from an uint32_t representing BGRA components. | |
static RgbaColourT | fromHSB (float hue, float saturation, float brightness) |
Constructor from an HSB components. | |
RGBA colour representation.
|
default |
|
default |
|
defaultnoexcept |
|
defaultnoexcept |
|
explicit |
Constructor from other component type.
[in] | rhs | The colour value. |
[in] | gamma | The gamma correction value. |
castor::RgbaColourT< ComponentType >::RgbaColourT | ( | float | r, |
float | g, | ||
float | b, | ||
float | a ) |
Specified Constructor.
|
inline |
Retrieves the alpha component value.
References castor::eAlpha, and castor::RgbaColourT< ComponentType >::get().
|
inline |
Retrieves the alpha component value.
References castor::eAlpha, and castor::RgbaColourT< ComponentType >::get().
|
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::RgbaColourT< ComponentType >::get().
|
inline |
Retrieves the blue component value.
References castor::eBlue, and castor::RgbaColourT< 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,a | The colour components |
References castor::eAlpha, 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::RgbaColourT< 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::RgbaColourT< 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::RgbaColourT< ComponentType >::alpha(), castor::RgbaColourT< ComponentType >::alpha(), castor::RgbaColourT< ComponentType >::blue(), castor::RgbaColourT< ComponentType >::blue(), castor::RgbaColourT< ComponentType >::green(), castor::RgbaColourT< ComponentType >::green(), castor::RgbaColourT< ComponentType >::red(), and castor::RgbaColourT< ComponentType >::red().
|
inline |
Retrieves the asked component value.
[in] | component | The asked component |
|
inline |
Retrieves the green component value.
References castor::eGreen, and castor::RgbaColourT< ComponentType >::get().
|
inline |
Retrieves the green component value.
References castor::eGreen, and castor::RgbaColourT< ComponentType >::get().
RgbaColourT & castor::RgbaColourT< 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.
RgbaColourT & castor::RgbaColourT< ComponentType >::operator+= | ( | ComponentType const & | component | ) |
addition assignment operator
[in] | component | The value to add |
RgbaColourT & castor::RgbaColourT< ComponentType >::operator+= | ( | RgbaColourT< 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.
RgbaColourT & castor::RgbaColourT< ComponentType >::operator-= | ( | ComponentType const & | component | ) |
Substraction assignment operator.
[in] | component | The value to subtract |
RgbaColourT & castor::RgbaColourT< ComponentType >::operator-= | ( | RgbaColourT< 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.
RgbaColourT & castor::RgbaColourT< 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::RgbaColourT< ComponentType >::get().
|
inline |
Retrieves the red component value.
References castor::eRed, and castor::RgbaColourT< ComponentType >::get().