#include <pg_col.h>
Public Member Functions | |
| pgCol () | |
| Constructs a pgCol. | |
| pgCol (const pgCol &col) | |
| Constructs and initializes a pgCol from the specified pgCol. | |
| pgCol (u8 r_, u8 g_, u8 b_, u8 a_=255) | |
| Constructs and initializes a pgCol from the specified components. | |
| void | set (u8 r_, u8 g_, u8 b_, u8 a_=255) |
| Sets all components from the specified components. | |
| bool | operator== (pgCol col) const |
| Returns whether this pgCol is equal to the right hand side pgCol. | |
| bool | operator!= (pgCol col) const |
| Returns whether this pgCol is unequal to the right hand side pgCol. | |
| pgCol | operator+ (pgCol col) const |
| Returns a pgCol which is the sum of this pgCol and the right hand side pgCol. | |
| void | operator+= (pgCol col) |
| Adds the right hand side pgCol to this pgCol. | |
| pgCol | operator- (pgCol col) const |
| Returns a pgCol which is the right hand side pgCol subtracted from this pgCol. | |
| void | operator-= (pgCol col) |
| Subtracts the right hand side pgCol from this pgCol. | |
| pgCol | operator* (pgCol col) const |
| Returns a pgCol which is this pgCol multiplied with right hand side pgCol and divided by 255. | |
| void | operator*= (pgCol col) |
| Multiplies this pgVec with the right hand side pgCol and divides by 255. | |
| pgCol | operator* (r32 s) const |
| Returns a pgCol which is this pgCol multiplied with right hand side scalar and divided by 255. | |
| void | operator*= (r32 s) |
| Multiplies this pgCol with the right hand side scalar. | |
| pgCol | operator/ (r32 s) const |
| Returns a pgCol which is this pgCol divided by the right hand side scalar. | |
| void | operator/= (r32 s) |
| Divides this pgCol by the right hand side scalar. | |
| pgCol | interp (pgCol to, r32 ratio) const |
| Returns a pgCol which is interpolated between this pgCol and an another pgCol by the specified ratio, using linear interpolation. | |
Public Attributes | |
| u8 | r |
| u8 | g |
| u8 | b |
| u8 | a |
Static Public Attributes | |
| static const pgCol | ZERO |
| The color whose all components are 0s. | |
| static const pgCol | FULL |
| The color whose all components are 255s. | |
Friends | |
| PG_API friend pgCol | operator* (r32 s, pgCol col) |
| Returns a pgCol which is the right hand side pgCol multiplied with the left hand side scalar. | |
| pgCol::pgCol | ( | const pgCol & | col | ) |
| pgCol::pgCol | ( | u8 | r_, | |
| u8 | g_, | |||
| u8 | b_, | |||
| u8 | a_ = 255 | |||
| ) |
Constructs and initializes a pgCol from the specified components.
| [in] | r_ | A red component. |
| [in] | g_ | A green component. |
| [in] | b_ | A blue component. |
| [in] | a_ | An alpha component. If not specified, 255 is used. |
Returns a pgCol which is interpolated between this pgCol and an another pgCol by the specified ratio, using linear interpolation.
param[in] to An another pgCol.
| [in] | ratio | The value which indicates how far to interpolate between two pgCols. This value is clamped between 0.0f and 1.0f. |
| bool pgCol::operator!= | ( | pgCol | col | ) | const |
| pgCol pgCol::operator* | ( | r32 | s | ) | const |
| void pgCol::operator*= | ( | r32 | s | ) |
Multiplies this pgCol with the right hand side scalar.
The values of the components are clamped between 0 and 255.
| [in] | The | right hand side scalar. |
| void pgCol::operator*= | ( | pgCol | col | ) |
| void pgCol::operator+= | ( | pgCol | col | ) |
| void pgCol::operator-= | ( | pgCol | col | ) |
| pgCol pgCol::operator/ | ( | r32 | s | ) | const |
| void pgCol::operator/= | ( | r32 | s | ) |
Divides this pgCol by the right hand side scalar.
The values of the components are clamped between 0 and 255.
| [in] | s | The right hand side scalar. |
| bool pgCol::operator== | ( | pgCol | col | ) | const |
| void pgCol::set | ( | u8 | r_, | |
| u8 | g_, | |||
| u8 | b_, | |||
| u8 | a_ = 255 | |||
| ) |
Sets all components from the specified components.
| [in] | r_ | A red component. |
| [in] | g_ | A green component. |
| [in] | b_ | A blue component. |
| [in] | a_ | An alpha component. If not specified, 255 is used. |
const pgCol pgCol::FULL [static] |
The color whose all components are 255s.
const pgCol pgCol::ZERO [static] |
The color whose all components are 0s.
1.5.8