[gimp] engrave: Rename variable color_n to num_channels



commit 35a62be10a9e6c7c9925d417398eb8e4279be0d0
Author: Mukund Sivaraman <muks banu com>
Date:   Thu Oct 13 10:15:29 2011 +0530

    engrave: Rename variable color_n to num_channels

 plug-ins/common/engrave.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/plug-ins/common/engrave.c b/plug-ins/common/engrave.c
index d0645bb..1797cc9 100644
--- a/plug-ins/common/engrave.c
+++ b/plug-ins/common/engrave.c
@@ -67,7 +67,7 @@ static void      engrave_small  (GimpDrawable *drawable,
 static void      engrave_sub    (gint          height,
                                  gboolean      limit,
                                  gint          bpp,
-                                 gint          color_n);
+                                 gint          num_channels);
 
 const GimpPlugInInfo PLUG_IN_INFO =
 {
@@ -425,7 +425,7 @@ engrave_small (GimpDrawable *drawable,
                GimpPreview  *preview)
 {
   GimpPixelRgn src_rgn, dest_rgn;
-  gint         bpp, color_n;
+  gint         bpp, num_channels;
   gint         x1, y1, x2, y2;
   gint         width, height;
   gint         progress, max_progress;
@@ -463,7 +463,7 @@ engrave_small (GimpDrawable *drawable,
   max_progress = width * height;
 
   bpp = drawable->bpp;
-  color_n = (gimp_drawable_is_rgb (drawable->drawable_id)) ? 3 : 1;
+  num_channels = (gimp_drawable_is_rgb (drawable->drawable_id)) ? 3 : 1;
 
   area.width = (tile_width / line_height) * line_height;
   area.data = g_new(guchar, (glong) bpp * area.width * area.width);
@@ -478,7 +478,7 @@ engrave_small (GimpDrawable *drawable,
           gimp_pixel_rgn_get_rect (&src_rgn, area.data, area.x, area.y, 1,
                                    area.h);
 
-          engrave_sub (line_height, limit, bpp, color_n);
+          engrave_sub (line_height, limit, bpp, num_channels);
 
           gimp_pixel_rgn_set_rect (&dest_rgn, area.data,
                                    area.x, area.y, 1, area.h);
@@ -512,9 +512,9 @@ static void
 engrave_sub (gint height,
              gint limit,
              gint bpp,
-             gint color_n)
+             gint num_channels)
 {
-  glong average[3];             /* color_n <= 3 */
+  glong average[3];             /* num_channels <= 3 */
   gint y, h, inten, v;
   guchar *buf_row, *buf;
   gint row;
@@ -534,7 +534,7 @@ engrave_sub (gint height,
       h = height - (y % height);
       h = MIN(h, area.y + area.h - y);
 
-      for (i = 0; i < color_n; i++)
+      for (i = 0; i < num_channels; i++)
         average[i] = 0;
       count = 0;
 
@@ -544,7 +544,7 @@ engrave_sub (gint height,
       for (row = 0; row < h; row++)
         {
           buf = buf_row;
-          for (i = 0; i < color_n; i++)
+          for (i = 0; i < num_channels; i++)
             average[i] += buf[i];
           count++;
           buf_row += rowstride;
@@ -552,7 +552,7 @@ engrave_sub (gint height,
 
       /* Average */
       if (count > 0)
-        for (i = 0; i < color_n; i++)
+        for (i = 0; i < num_channels; i++)
           average[i] /= count;
 
       if (bpp < 3)
@@ -576,7 +576,7 @@ engrave_sub (gint height,
               else if (row == height-1)
                 v = 0;
             }
-          for (i = 0; i < color_n; i++)
+          for (i = 0; i < num_channels; i++)
             buf[i] = v;
           buf_row += rowstride;
         }



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