about summary refs log tree commit diff
path: root/editor/pambackground.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-09-30 21:11:36 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-09-30 21:11:36 +0000
commitb4fd5fc9c4e8469d412cb5e8496b8caee3dc8697 (patch)
tree109a1a2cdd72100d20dde0c43b58ec41e23be379 /editor/pambackground.c
parent81a60abcf774f1a1203cb7daae663f7c24870d41 (diff)
downloadnetpbm-mirror-b4fd5fc9c4e8469d412cb5e8496b8caee3dc8697.tar.gz
netpbm-mirror-b4fd5fc9c4e8469d412cb5e8496b8caee3dc8697.tar.xz
netpbm-mirror-b4fd5fc9c4e8469d412cb5e8496b8caee3dc8697.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4143 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/pambackground.c')
-rw-r--r--editor/pambackground.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/editor/pambackground.c b/editor/pambackground.c
index f36e7323..218f5b7e 100644
--- a/editor/pambackground.c
+++ b/editor/pambackground.c
@@ -301,8 +301,8 @@ expandBackgroundHoriz(unsigned char ** const pi,
                       unsigned int     const height,
                       bool *           const expandedP) {
 /*----------------------------------------------------------------------------
-   In every row, expand the background rightward from any known background
-   pixel through all consecutive unknown pixels.
+   In every row except top and bottom, expand the background rightward from
+   any known background pixel through all consecutive unknown pixels.
 
    Then do the same thing leftward.
 
@@ -343,8 +343,9 @@ expandBackgroundVert(unsigned char ** const pi,
                      unsigned int     const height,
                      bool *           const expandedP) {
 /*----------------------------------------------------------------------------
-   In every column, expand the background downward from any known background
-   pixel through all consecutive unknown pixels.
+   In every column except leftmost and rightmost, expand the background
+   downward from any known background pixel through all consecutive unknown
+   pixels.
 
    Then do the same thing upward.
 
@@ -400,7 +401,7 @@ findBackgroundPixels(struct pam *                   const inpamP,
 -----------------------------------------------------------------------------*/
     unsigned char ** pi;
     bool backgroundComplete;
-    unsigned int passes;
+    unsigned int passCt;
 
     pi = newPi(inpamP->width, inpamP->height);
 
@@ -409,7 +410,7 @@ findBackgroundPixels(struct pam *                   const inpamP,
     setEdges(pi, inpamP->width, inpamP->height);
 
     backgroundComplete = FALSE;
-    passes = 0;
+    passCt = 0;
 
     while (!backgroundComplete) {
         bool expandedHoriz, expandedVert;
@@ -422,11 +423,11 @@ findBackgroundPixels(struct pam *                   const inpamP,
 
         backgroundComplete = !expandedHoriz && !expandedVert;
 
-        ++passes;
+        ++passCt;
     }
 
     if (verbose)
-        pm_message("Background found in %u passes", passes);
+        pm_message("Background found in %u passes", passCt);
 
     *piP = (const unsigned char * const *)pi;
 }