Author: Carlos Lopez <[email protected]>
Date:   Wed Oct 24 20:51:44 2012 +0200

ETL:: gaussian_: when storing the gaussian result convert it to the value_type. 
It would force to clamp before store on the surface for limited range 
value_types (like unsigned char)

---

 ETL/ETL/_gaussian.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ETL/ETL/_gaussian.h b/ETL/ETL/_gaussian.h
index 020eafe..dd38123 100644
--- a/ETL/ETL/_gaussian.h
+++ b/ETL/ETL/_gaussian.h
@@ -91,7 +91,7 @@ typename T::accumulator_pointer SC3)
                        Tmp2=SC2[x]+Tmp1;
                        SC2[x]=Tmp1;
                        if(y>1&&x>1)
-                               pen[-2][-2]=(SC3[x]+Tmp2)/256;
+                               pen[-2][-2]=(typename 
T::value_type)((SC3[x]+Tmp2)/256);
                        SC3[x]=Tmp2;
                }
                pen.dec_x(x);
@@ -171,7 +171,7 @@ gaussian_blur_3x3(T pen,int w, int h)
                        Tmp2=SC0[x]+Tmp1;
                        SC0[x]=Tmp1;
                        if(y&&x)
-                               pen[-1][-1]=(SC1[x]+Tmp2)/16;
+                               pen[-1][-1]=(typename 
T::value_type)((SC1[x]+Tmp2)/16);
                        SC1[x]=Tmp2;
                }
                pen.dec_x(x);


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to