diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-24 00:47:13 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-24 00:47:13 +0000 |
commit | aaa4ff61f7b17759c4f4ccb3ac9011dd5f8a93f5 (patch) | |
tree | fafec5ef0c99f28cfa6b5b652d98b63b7a4673de /src/math | |
parent | 11c122eb1cc86ca1a40c84eb411ccd97791dc47d (diff) |
primary, secondary, tertiary color rendering
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/color.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/math/color.h b/src/math/color.h index 4f3df16..c938708 100644 --- a/src/math/color.h +++ b/src/math/color.h @@ -49,7 +49,22 @@ public: /// multiply rgb values with scalar value. Color & operator*=(const float scalar); - inline float operator[](size_t index) const { return rgba_data[index]; } + /// assign a value to an element of this color + /*! WARNING: range is not checked + * @param index the index of the element to assign to ( 0 <= index < 4 ) + */ + inline float& operator[](const size_t index) { + return rgba_data[index]; + } + + /// returns the value of an element of this color + /*! WARNING: range is not checked + * @param index the index of the element to return ( 0 <= index < 4 ) + */ + inline float operator[](const size_t index) const { + return rgba_data[index]; + } + /// pointer to the internal data inline float *ptr() const { return (float *) rgba_data; }; |