Move the gamma_in and gamma_out macros into "color.h".
[synfig.git] / synfig-core / trunk / src / synfig / color.h
index 447bd56..35e2857 100644 (file)
 /* === H E A D E R S ======================================================= */
 
 
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#include <string>
-
 //#include <cmath>
 #include <math.h>
 #include <cassert>
 
 /* === M A C R O S ========================================================= */
 
+#define use_colorspace_gamma() App::use_colorspace_gamma
+#define colorspace_gamma()     (2.2f)
+#define gamma_in(x)            ((x>=0)?pow((float)x,1.0f/colorspace_gamma()):-pow((float)-x,1.0f/colorspace_gamma()))
+#define gamma_out(x)   ((x>=0)?pow((float)x,colorspace_gamma()):-pow((float)-x,colorspace_gamma()))
+
 #ifdef WIN32
 #include <float.h>
 #ifndef isnan
@@ -115,12 +115,7 @@ private:
 
 public:
 
-       inline const String get_string(void)const
-       {
-               std::ostringstream o;
-               o << std::fixed << std::setprecision(3) << "#" << get_hex() << " : " << std::setw(6) << a_;
-               return String(o.str().c_str());
-       }
+       const String get_string(void)const;
 
        Color &
        operator+=(const Color &rhs)