Revision: 2329
          http://synfig.svn.sourceforge.net/synfig/?rev=2329&view=rev
Author:   dooglus
Date:     2009-01-13 15:44:10 +0000 (Tue, 13 Jan 2009)

Log Message:
-----------
Fix 2502818: Noise when refresh an imported image layer.

Modified Paths:
--------------
    synfig-core/trunk/src/synfig/layer_bitmap.cpp
    synfig-core/trunk/src/synfig/layer_bitmap.h

Modified: synfig-core/trunk/src/synfig/layer_bitmap.cpp
===================================================================
--- synfig-core/trunk/src/synfig/layer_bitmap.cpp       2009-01-13 06:03:12 UTC 
(rev 2328)
+++ synfig-core/trunk/src/synfig/layer_bitmap.cpp       2009-01-13 15:44:10 UTC 
(rev 2329)
@@ -165,16 +165,14 @@
 
 inline
 const Color&
-synfig::Layer_Bitmap::filter(const Color& c)const
+synfig::Layer_Bitmap::filter(Color& x)const
 {
-       if(gamma_adjust==1.0)
-               return c;
-       static Color x;
-       x=c;
-
-       x.set_r(powf((float)x.get_r(),gamma_adjust));
-       x.set_g(powf((float)x.get_g(),gamma_adjust));
-       x.set_b(powf((float)x.get_b(),gamma_adjust));
+       if(gamma_adjust!=1.0)
+       {
+               x.set_r(powf((float)x.get_r(),gamma_adjust));
+               x.set_g(powf((float)x.get_g(),gamma_adjust));
+               x.set_b(powf((float)x.get_b(),gamma_adjust));
+       }
        return x;
 }
 
@@ -458,7 +456,8 @@
                        inx = inx_start;
                        for(x = x_start; x < x_end; x++, pen.inc_x(), inx += 
indx)
                        {
-                               
pen.put_value(filter(surface.linear_sample(inx,iny)));
+                               Color col(surface.linear_sample(inx,iny));
+                               pen.put_value(filter(col));
                        }
                        pen.dec_x(x_end-x_start);
 
@@ -483,7 +482,8 @@
                        inx = inx_start;
                        for(x = x_start; x < x_end; x++, pen.inc_x(), inx += 
indx)
                        {
-                               
pen.put_value(filter(surface.cosine_sample(inx,iny)));
+                               Color col(surface.cosine_sample(inx,iny));
+                               pen.put_value(filter(col));
                        }
                        pen.dec_x(x_end-x_start);
 
@@ -507,7 +507,8 @@
                        inx = inx_start;
                        for(x = x_start; x < x_end; x++, pen.inc_x(), inx += 
indx)
                        {
-                               
pen.put_value(filter(surface.cubic_sample(inx,iny)));
+                               Color col(surface.cubic_sample(inx,iny));
+                               pen.put_value(filter(col));
                        }
                        pen.dec_x(x_end-x_start);
 

Modified: synfig-core/trunk/src/synfig/layer_bitmap.h
===================================================================
--- synfig-core/trunk/src/synfig/layer_bitmap.h 2009-01-13 06:03:12 UTC (rev 
2328)
+++ synfig-core/trunk/src/synfig/layer_bitmap.h 2009-01-13 15:44:10 UTC (rev 
2329)
@@ -43,7 +43,7 @@
 */
 class Layer_Bitmap : public Layer_Composite, public Layer_NoDeform
 {
-       const Color& filter(const Color& c)const;
+       const Color& filter(Color& c)const;
 public:
        typedef etl::handle<Layer_Bitmap> Handle;
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to