gegl r2190 - in trunk: . operations/common



Author: ok
Date: Fri Apr 18 09:27:52 2008
New Revision: 2190
URL: http://svn.gnome.org/viewvc/gegl?rev=2190&view=rev

Log:
* operations/common/brightness-contrast.c: (process_sse):
* operations/common/invert.c: (process_sse): make use of stack
allocated vector constants.


Modified:
   trunk/ChangeLog
   trunk/operations/common/brightness-contrast.c
   trunk/operations/common/invert.c

Modified: trunk/operations/common/brightness-contrast.c
==============================================================================
--- trunk/operations/common/brightness-contrast.c	(original)
+++ trunk/operations/common/brightness-contrast.c	Fri Apr 18 09:27:52 2008
@@ -116,16 +116,15 @@
   GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
   GeglV4     *in  = in_buf;
   GeglV4     *out = out_buf;
-  GeglV4      half={{0.5,0.5,0.5,0.5}};
-  GeglV4      brightness={{o->brightness + 0.5,
-                           o->brightness + 0.5,
-                           o->brightness + 0.5,
-                           0.0}};
-  GeglV4      contrast={{o->contrast, o->contrast,o->contrast, 1.0}};
+  GeglV4      brightness = GEGL_V4_FILL(o->brightness + 0.5);
+  GeglV4      contrast   = GEGL_V4_FILL(o->contrast);
+    
+  brightness.a[3]=0.5;
+  contrast.a[3]=1.0;
 
   while (--samples)
     {
-      out->v = (in->v - half.v) * contrast.v + brightness.v;
+      out->v = (in->v - GEGL_V4_HALF.v) * contrast.v + brightness.v;
       in  ++;
       out ++;
     }

Modified: trunk/operations/common/invert.c
==============================================================================
--- trunk/operations/common/invert.c	(original)
+++ trunk/operations/common/invert.c	Fri Apr 18 09:27:52 2008
@@ -63,12 +63,12 @@
 {
   GeglV4 *in  = in_buf;
   GeglV4 *out = out_buf;
-  GeglV4  one={{1.0,1.0,1.0,1.0}};
 
   while (--samples)
     {
-      out->v = one.v - in->v;
-      out->a[3]=in->a[3];
+      gfloat a=in->a[3];
+      out->v = GEGL_V4_ONE.v - in->v;
+      out->a[3]=a;
       in  ++;
       out ++;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]