![]() |
![]() |
![]() |
| HOME | DOWNLOAD | DOCS | DEVELOPMENT | LICENSE | CREDITS |
Color vector. More...
#include <iColor.h>
Public Member Functions | |
| iColor () | |
| Default constructor. | |
| iColor (int red, int green, int blue, int alpha=255) | |
| Full color constructor. | |
| iColor (int value) | |
| Single color constructor. | |
| int | length () const |
| Gets the length of the color vector. | |
| int | sqrLength () const |
| Gets the square length of the color vector. | |
| int | distanceTo (const iColor &col) const |
| Gets the distance from this color vector to another iColor. | |
| int | dot (const iColor &col) const |
| Gets the dot product of this color vector with another iColor. | |
| iColor | cross (const iColor &col) const |
| Gets the cross product of this color vector with another iColor. | |
| void | normalize () |
| Normalizes the color vector. | |
| int | average () const |
| Returns an average of the color channels. | |
| void | clamp () |
| Clamps all colors within the 0-255 range. | |
| iColor | operator+ (const iColor &c) const |
| iColor | operator- (const iColor &c) const |
| iColor | operator* (const iColor &c) const |
| iColor | operator/ (const iColor &c) const |
| iColor | operator= (const iColor &c) |
| iColor | operator+= (const iColor &c) |
| iColor | operator-= (const iColor &c) |
| iColor | operator*= (const iColor &c) |
| iColor | operator/= (const iColor &c) |
| bool | operator== (const iColor &c) const |
| bool | operator!= (const iColor &c) const |
| iColor | operator* (float i) const |
Public Attributes | |
| int | r |
| Red component. | |
| int | g |
| Green component. | |
| int | b |
| Blue component. | |
| int | a |
| Alpha component. | |
Color vector.
This class stores each color channel as an integer. Range: 0-255.
| imagen::iColor::iColor | ( | ) | [inline] |
Default constructor.
| imagen::iColor::iColor | ( | int | red, |
| int | green, | ||
| int | blue, | ||
| int | alpha = 255 |
||
| ) | [inline] |
Full color constructor.
| red | : Red value. |
| green | : Green value. |
| blue | : Blue value. |
| alpha | : Alpha value. |
| imagen::iColor::iColor | ( | int | value | ) | [inline] |
Single color constructor.
| value | : Value to apply to all components. |
| int imagen::iColor::length | ( | ) | const [inline] |
Gets the length of the color vector.
| int imagen::iColor::sqrLength | ( | ) | const [inline] |
Gets the square length of the color vector.
| int imagen::iColor::distanceTo | ( | const iColor & | col | ) | const [inline] |
| int imagen::iColor::dot | ( | const iColor & | col | ) | const [inline] |
| iColor imagen::iColor::cross | ( | const iColor & | col | ) | const [inline] |
| void imagen::iColor::normalize | ( | ) | [inline] |
Normalizes the color vector.
| int imagen::iColor::average | ( | ) | const [inline] |
Returns an average of the color channels.
| void imagen::iColor::clamp | ( | ) | [inline] |
Clamps all colors within the 0-255 range.
| bool imagen::iColor::operator== | ( | const iColor & | c | ) | const [inline] |
| bool imagen::iColor::operator!= | ( | const iColor & | c | ) | const [inline] |
| iColor imagen::iColor::operator* | ( | float | i | ) | const [inline] |
Red component.
Green component.
Blue component.
Alpha component.
API Documentation by Mark D. Procarione |
Generated by
![]() |