#include <Color.h>
Public Member Functions | |
MCORE_INLINE | RGBAColor () |
MCORE_INLINE | RGBAColor (float value) |
MCORE_INLINE | RGBAColor (float cR, float cG, float cB, float cA=1.0f) |
MCORE_INLINE | RGBAColor (const RGBAColor &col) |
RGBAColor (uint32 col) | |
RGBAColor (const AZ::Color &color) | |
operator AZ::Color () const | |
MCORE_INLINE void | Set (float cR, float cG, float cB, float cA) |
MCORE_INLINE void | Set (const RGBAColor &color) |
MCORE_INLINE void | Zero () |
MCORE_INLINE RGBAColor & | Clamp () |
MCORE_INLINE float | CalcLength () const |
MCORE_INLINE float | CalcIntensity () const |
MCORE_INLINE bool | CheckIfIsClose (const RGBAColor &col, float distSq=0.0001f) const |
MCORE_INLINE uint32 | ToInt () const |
MCORE_INLINE RGBAColor & | Exposure (float exposure=1.5f) |
MCORE_INLINE RGBAColor & | Normalize () |
MCORE_INLINE bool | operator== (const RGBAColor &col) const |
MCORE_INLINE const RGBAColor & | operator*= (const RGBAColor &col) |
MCORE_INLINE const RGBAColor & | operator+= (const RGBAColor &col) |
MCORE_INLINE const RGBAColor & | operator-= (const RGBAColor &col) |
MCORE_INLINE const RGBAColor & | operator*= (float m) |
MCORE_INLINE const RGBAColor & | operator/= (float d) |
MCORE_INLINE const RGBAColor & | operator= (const RGBAColor &col) |
MCORE_INLINE const RGBAColor & | operator= (float colorValue) |
MCORE_INLINE float & | operator[] (int32 row) |
MCORE_INLINE | operator float * () |
MCORE_INLINE | operator const float * () const |
Public Attributes | |
float | m_r |
float | m_g |
float | m_b |
float | m_a |
The high precision color class. This template should be used with floats or doubles. Default predefined types are: RGBAColor, FRGBAColor, DRGBAColor. The component values go from 0 to 1, where 0 is black and 1 is white in case all components had this same value. It however is possible to go higher than 1. Color component values can also be clamped, normalized and affected by exposure control.
|
inline |
Default constructor. Color will be set to black (0,0,0,0).
|
inline |
Constructor which sets all components to the same given value.
value | The value to put in all components (r,g,b,a). |
|
inline |
Constructor which sets each color component.
cR | The value for red. |
cG | The value for green. |
cB | The value for blue. |
cA | The value for alpha [default=1.0] |
|
inline |
Copy constructor.
col | The color to copy the component values from. |
|
inline |
Constructor to convert a 32-bits DWORD to a high precision color.
col | The 32-bits DWORD, for example constructed using the MCore::RGBA(...) function. |
|
inline |
Constructor to convert from AZ::Color. This constructor is convenient until we replace the usage of this class with AZ::Color
color | The AZ::Color to construct from |
|
inline |
Calculates and returns the intensity of the color. This gives an idea of how bright the color would be on the screen.
|
inline |
Returns the length of the color components (r, g, b), just like you calculate the length of a vector. The higher the length value, the more bright the color will be.
|
inline |
Checks if this color is close to another given color.
col | The other color to compare with. |
distSq | The square distance of maximum tollerance of the difference. A value of 0 would mean the colors have to be exactly the same. |
|
inline |
Clamp all color component values in a range of 0..1 This can screw up your colors of course. Unless you just want to clamp we advise you to use the Exposure method for exposure control or the Normalize method.
|
inline |
Perform exposure control on the color components. This will give much better results than just clamping the values between 0 and 1.
exposure | The exposure value [default=1.5] |
|
inline |
Smart normalizes the color. This means it will scale the values in a range of 0..1 if they are out of range. It picks the value of the component with the highest value. And makes this into a value of 1, while scaling the others down with the correct amounts. So it's not really normalizing like you normalize a vector, but it is a little bit more intelligent and will only perform it when needed, so it won't touch the colors if they are already in range of 0..1.
|
inline |
Automatic conversion to AZ::Color until we remove the u sage of this class with AZ::Color
|
inline |
Set the color component values.
color | The color to set. |
|
inline |
Set the color component values.
cR | The value for red. |
cG | The value for green. |
cB | The value for blue. |
cA | The value for alpha. |
|
inline |
Convert this high precision color to a 32-bit DWORD value. In order to work correctly, the color component values must be in range of 0..1. So they have to be clamped, normalized or exposure controlled before calling this method.
|
inline |
Clear the color component values. Set them all to zero, so the color turns into black.
float MCore::RGBAColor::m_a |
Alpha component.
float MCore::RGBAColor::m_b |
Blue component.
float MCore::RGBAColor::m_g |
Green component.
float MCore::RGBAColor::m_r |
Red component.