Small color object for each particle. More...
#include <b2Particle.h>
Public Member Functions | |
b2Inline | b2ParticleColor (uint8 r, uint8 g, uint8 b, uint8 a) |
b2ParticleColor (const b2Color &color) | |
bool | IsZero () const |
b2Color | GetColor () const |
b2Inline void | Set (uint8 r_, uint8 g_, uint8 b_, uint8 a_) |
void | Set (const b2Color &color) |
b2ParticleColor & | operator= (const b2ParticleColor &color) |
Assign a b2ParticleColor to this instance. | |
b2ParticleColor & | operator*= (float32 s) |
b2ParticleColor & | operator*= (uint8 s) |
Scales r, g, b, a members by s where s is a value between 0 and 255. | |
b2ParticleColor | operator* (float32 s) const |
Scales r, g, b, a members by s returning the modified b2ParticleColor. | |
b2ParticleColor | operator* (uint8 s) const |
Scales r, g, b, a members by s returning the modified b2ParticleColor. | |
b2Inline b2ParticleColor & | operator+= (const b2ParticleColor &color) |
b2ParticleColor | operator+ (const b2ParticleColor &color) const |
b2Inline b2ParticleColor & | operator-= (const b2ParticleColor &color) |
b2ParticleColor | operator- (const b2ParticleColor &color) const |
bool | operator== (const b2ParticleColor &color) const |
Compare this color with the specified color. | |
b2Inline void | Mix (b2ParticleColor *const mixColor, const int32 strength) |
Static Public Member Functions | |
static b2Inline void | MixColors (b2ParticleColor *const colorA, b2ParticleColor *const colorB, const int32 strength) |
Public Attributes | |
uint8 | r |
uint8 | g |
uint8 | b |
uint8 | a |
Static Protected Attributes | |
static const float32 | k_maxValue = (float)B2PARTICLECOLOR_MAX_VALUE |
Maximum value of a b2ParticleColor component. | |
static const float32 | k_inverseMaxValue |
1.0 / k_maxValue. More... | |
static const uint8 | k_bitsPerComponent |
Number of bits used to store each b2ParticleColor component. More... | |
Small color object for each particle.
|
inline |
Constructor with four elements: r (red), g (green), b (blue), and a (opacity). Each element can be specified 0 to 255.
b2ParticleColor::b2ParticleColor | ( | const b2Color & | color | ) |
Constructor that initializes the above four elements with the value of the b2Color object.
|
inline |
True when all four color elements equal 0. When true, a particle color buffer isn't allocated by CreateParticle().
|
inline |
Mix mixColor with this color using strength to control how much of mixColor is mixed with this color and vice versa. The range of strength is 0..128 where 0 results in no color mixing and 128 results in an equal mix of both colors. strength 0..128 is analogous to an alpha channel value between 0.0f..0.5f.
|
inlinestatic |
Mix colorA with colorB using strength to control how much of colorA is mixed with colorB and vice versa. The range of strength is 0..128 where 0 results in no color mixing and 128 results in an equal mix of both colors. strength 0..128 is analogous to an alpha channel value between 0.0f..0.5f.
|
inline |
Multiplies r, g, b, a members by s where s is a value between 0.0 and 1.0.
|
inline |
Add two colors. This is a non-saturating addition so values overflows will wrap.
|
inline |
Add two colors. This is a non-saturating addition so values overflows will wrap.
|
inline |
Subtract a color from this color returning the result. This is a subtraction without saturation so underflows will wrap.
|
inline |
Subtract a color from this color. This is a subtraction without saturation so underflows will wrap.
|
inline |
Sets color for current object using the four elements described above.
void b2ParticleColor::Set | ( | const b2Color & | color | ) |
Initializes the object with the value of the b2Color.
|
staticprotected |
Number of bits used to store each b2ParticleColor component.
|
staticprotected |
1.0 / k_maxValue.