aboutsummaryrefslogtreecommitdiffstats
path: root/meowpp/colors/RGB.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'meowpp/colors/RGB.hpp')
-rw-r--r--meowpp/colors/RGB.hpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/meowpp/colors/RGB.hpp b/meowpp/colors/RGB.hpp
index 1364814..0e0381d 100644
--- a/meowpp/colors/RGB.hpp
+++ b/meowpp/colors/RGB.hpp
@@ -6,6 +6,9 @@
#include "../math/utility.h"
+#include "../geo/Vector3D.h"
+#include "../math/Matrix.h"
+
namespace meow{
template<class T>
inline RGB<T>::RGB(){ }
@@ -47,7 +50,34 @@ namespace meow{
inline T RGB<T>::bgr(size_t i, T const& val){
return rgb(2 - i, val);
}
-
+ template<class T>
+ inline T RGB<T>::rgb(T const& __r, T const& __g, T const& __b){
+ r(__r);
+ g(__g);
+ b(__b);
+ }
+ template<class T>
+ inline T RGB<T>::bgr(T const& __b, T const& __g, T const& __r){
+ r(__r);
+ g(__g);
+ b(__b);
+ }
+ template<class T>
+ inline Matrix<T> RGB<T>::matrix() const{
+ static Matrix<T> ret(3, 1, T(0));
+ ret(0, 0) = r();
+ ret(1, 0) = g();
+ ret(2, 0) = b();
+ return ret;
+ }
+ template<class T>
+ inline Vector3D<T> RGB<T>::vector() const{
+ static Vector3D<T> ret;
+ ret(0) = r();
+ ret(1) = g();
+ ret(2) = b();
+ return ret;
+ }
inline RGBf::RGBf(): RGB(0.0, 0.0, 0.0){ }