Author: Diego Barrios Romero <[email protected]>
Date: Tue Jun 12 13:42:56 2012 +0200
Adapt all to the new floor and ceil variables
---
synfig-core/src/synfig/color.cpp | 12 +++++-------
synfig-core/src/synfig/colorblender.cpp | 16 ++++++++--------
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/synfig-core/src/synfig/color.cpp b/synfig-core/src/synfig/color.cpp
index 0080ea5..ca82c85 100644
--- a/synfig-core/src/synfig/color.cpp
+++ b/synfig-core/src/synfig/color.cpp
@@ -53,8 +53,6 @@ using namespace std;
/* === M E T H O D S ======================================================= */
-
-
ColorReal
Color::hex2real(String s)
{
@@ -88,7 +86,7 @@ Color::real2hex(ColorReal c)
const String
CairoColor::char2hex(unsigned char c)
{
- String s(Color::real2hex((ColorReal)(c/((float)ceil()))));
+ String s(Color::real2hex((ColorReal)(c/((float)ceil))));
return s.c_str();
}
@@ -236,10 +234,10 @@ Color::clamped()const
Color::Color(const CairoColor& c): ColorBase<value_type>()
{
-
set_r((ceil()-floor())*c.get_r()/(CairoColor::ceil()-CairoColor::floor()));
-
set_g((ceil()-floor())*c.get_g()/(CairoColor::ceil()-CairoColor::floor()));
-
set_b((ceil()-floor())*c.get_b()/(CairoColor::ceil()-CairoColor::floor()));
-
set_a((ceil()-floor())*c.get_a()/(CairoColor::ceil()-CairoColor::floor()));
+
set_r((ceil-floor)*c.get_r()/(CairoColor::ceil-CairoColor::floor));
+
set_g((ceil-floor)*c.get_g()/(CairoColor::ceil-CairoColor::floor));
+
set_b((ceil-floor)*c.get_b()/(CairoColor::ceil-CairoColor::floor));
+
set_a((ceil-floor)*c.get_a()/(CairoColor::ceil-CairoColor::floor));
}
diff --git a/synfig-core/src/synfig/colorblender.cpp
b/synfig-core/src/synfig/colorblender.cpp
index 69b583a..8d8b175 100644
--- a/synfig-core/src/synfig/colorblender.cpp
+++ b/synfig-core/src/synfig/colorblender.cpp
@@ -32,7 +32,7 @@ C ColorBlender::blendfunc_COMPOSITE(C &src,C &dest,float
amount)
float a_src=src.get_a()*amount;
float a_dest=dest.get_a();
- const float one(C::ceil());
+ const float one(C::ceil);
// if a_arc==0.0
//if(fabsf(a_src)<COLOR_EPSILON) return dest;
@@ -90,7 +90,7 @@ template <class C>
C ColorBlender::blendfunc_ONTO(C &a,C &b,float amount)
{
float alpha(b.get_a());
- const float one(C::ceil());
+ const float one(C::ceil);
b.set_a(one);
C c = blendfunc_COMPOSITE(a,b,amount);
c.set_a(alpha);
@@ -125,7 +125,7 @@ template <class C>
C ColorBlender::blendfunc_DARKEN(C &a,C &b,float amount)
{
const float alpha(a.get_a()*amount);
- const float one(C::ceil());
+ const float one(C::ceil);
if(b.get_r()>(a.get_r()-one)*alpha+one)
b.set_r((a.get_r()-one)*alpha+one);
@@ -273,7 +273,7 @@ C ColorBlender::blendfunc_ALPHA_DARKEN(C &a,C &b,float
amount)
template <class C>
C ColorBlender::blendfunc_SCREEN(C &a,C &b,float amount)
{
- const float one(C::ceil());
+ const float one(C::ceil);
if(amount<0) a=~a, amount=-amount;
a.set_r(one-(one-a.get_r())*(one-b.get_r()));
@@ -286,7 +286,7 @@ C ColorBlender::blendfunc_SCREEN(C &a,C &b,float amount)
template <class C>
C ColorBlender::blendfunc_OVERLAY(C &a,C &b,float amount)
{
- const float one(C::ceil());
+ const float one(C::ceil);
if(amount<0) a=~a, amount=-amount;
C rm;
@@ -311,8 +311,8 @@ C ColorBlender::blendfunc_OVERLAY(C &a,C &b,float amount)
template <class C>
C ColorBlender::blendfunc_HARD_LIGHT(C &a,C &b,float amount)
{
- const float one(C::ceil());
- const float half((one-C::floor())/2);
+ const float one(C::ceil);
+ const float half((one-C::floor)/2);
if(amount<0) a=~a, amount=-amount;
if(a.get_r()>half)
a.set_r(one-(one-(a.get_r()*2*one-one))*(one-b.get_r()));
@@ -328,7 +328,7 @@ C ColorBlender::blendfunc_HARD_LIGHT(C &a,C &b,float amount)
template <class C>
C ColorBlender::blendfunc_ALPHA_OVER(C &a,C &b,float amount)
{
- const float one(C::ceil());
+ const float one(C::ceil);
C rm(b);
//multiply the inverse alpha channel with the one below us
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl