From b4fd5fc9c4e8469d412cb5e8496b8caee3dc8697 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 30 Sep 2021 21:11:36 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4143 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- editor/pambackground.c | 17 +++++++++-------- 1 file 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; } -- cgit 1.4.1