gimp r24636 - in trunk: . app/gegl



Author: mitch
Date: Thu Jan 17 14:38:45 2008
New Revision: 24636
URL: http://svn.gnome.org/viewvc/gimp?rev=24636&view=rev

Log:
2008-01-17  Michael Natterer  <mitch gimp org>

	* app/gegl/gimpoperationcolorize.c
	* app/gegl/gimpoperationhuesaturation.c (process): move some
	calculations and assignments out of the inner loop.



Modified:
   trunk/ChangeLog
   trunk/app/gegl/gimpoperationcolorize.c
   trunk/app/gegl/gimpoperationhuesaturation.c

Modified: trunk/app/gegl/gimpoperationcolorize.c
==============================================================================
--- trunk/app/gegl/gimpoperationcolorize.c	(original)
+++ trunk/app/gegl/gimpoperationcolorize.c	Thu Jan 17 14:38:45 2008
@@ -169,11 +169,14 @@
   GimpOperationColorize *self = GIMP_OPERATION_COLORIZE (operation);
   gfloat                *src  = in_buf;
   gfloat                *dest = out_buf;
+  GimpHSL                hsl;
   glong                  sample;
 
+  hsl.h = self->hue;
+  hsl.s = self->saturation;
+
   for (sample = 0; sample < samples; sample++)
     {
-      GimpHSL hsl;
       GimpRGB rgb;
       gfloat  lum = GIMP_RGB_LUMINANCE (src[RED_PIX],
                                         src[GREEN_PIX],
@@ -190,8 +193,6 @@
           lum = lum * (self->lightness + 1.0);
         }
 
-      hsl.h = self->hue;
-      hsl.s = self->saturation;
       hsl.l = lum;
 
       gimp_hsl_to_rgb (&hsl, &rgb);

Modified: trunk/app/gegl/gimpoperationhuesaturation.c
==============================================================================
--- trunk/app/gegl/gimpoperationhuesaturation.c	(original)
+++ trunk/app/gegl/gimpoperationhuesaturation.c	Thu Jan 17 14:38:45 2008
@@ -266,9 +266,10 @@
                                        void          *out_buf,
                                        glong          samples)
 {
-  GimpOperationHueSaturation *self = GIMP_OPERATION_HUE_SATURATION (operation);
-  gfloat                     *src  = in_buf;
-  gfloat                     *dest = out_buf;
+  GimpOperationHueSaturation *self    = GIMP_OPERATION_HUE_SATURATION (operation);
+  gfloat                     *src     = in_buf;
+  gfloat                     *dest    = out_buf;
+  gfloat                      overlap = self->overlap / 2.0;
   glong                       sample;
 
   for (sample = 0; sample < samples; sample++)
@@ -282,7 +283,6 @@
       gboolean use_secondary_hue   = FALSE;
       gfloat   primary_intensity   = 0.0;
       gfloat   secondary_intensity = 0.0;
-      gfloat   overlap             = self->overlap / 2.0;
 
       rgb.r = src[RED_PIX];
       rgb.g = src[GREEN_PIX];



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