From c57fb692012684f1a5b1e84c2e31dc289ef70219 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 20 Sep 2023 18:09:49 +0000 Subject: whitespace git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4671 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- analyzer/pamfile.c | 28 +++++++------- analyzer/pamsharpmap.c | 26 ++++++------- analyzer/pamsharpness.c | 26 ++++++------- analyzer/pamslice.c | 22 +++++------ analyzer/pbmminkowski.c | 62 +++++++++++++++--------------- analyzer/pgmhist.c | 6 +-- analyzer/pgmminkowski.c | 100 ++++++++++++++++++++++++------------------------ analyzer/pnmhistmap.c | 28 +++++++------- 8 files changed, 149 insertions(+), 149 deletions(-) (limited to 'analyzer') diff --git a/analyzer/pamfile.c b/analyzer/pamfile.c index 7b61f6fd..6e12375f 100644 --- a/analyzer/pamfile.c +++ b/analyzer/pamfile.c @@ -92,30 +92,30 @@ dumpHeaderHuman(struct pam const pam) { printf(" Tuple type: %s\n", pam.tuple_type); break; - case PBM_FORMAT: + case PBM_FORMAT: printf("PBM plain, %d by %d\n", pam.width, pam.height ); break; - case RPBM_FORMAT: + case RPBM_FORMAT: printf("PBM raw, %d by %d\n", pam.width, pam.height); break; - case PGM_FORMAT: + case PGM_FORMAT: printf("PGM plain, %d by %d maxval %ld\n", pam.width, pam.height, pam.maxval); break; - case RPGM_FORMAT: + case RPGM_FORMAT: printf("PGM raw, %d by %d maxval %ld\n", pam.width, pam.height, pam.maxval); break; - case PPM_FORMAT: + case PPM_FORMAT: printf("PPM plain, %d by %d maxval %ld\n", pam.width, pam.height, pam.maxval); break; - case RPPM_FORMAT: + case RPPM_FORMAT: printf("PPM raw, %d by %d maxval %ld\n", pam.width, pam.height, pam.maxval); break; @@ -136,32 +136,32 @@ dumpHeaderMachine(struct pam const pam) { plain = false; break; - case PBM_FORMAT: + case PBM_FORMAT: formatString = "PBM"; plain = TRUE; break; - case RPBM_FORMAT: + case RPBM_FORMAT: formatString = "PBM"; plain = false; break; - case PGM_FORMAT: + case PGM_FORMAT: formatString = "PGM"; plain = TRUE; break; - case RPGM_FORMAT: + case RPGM_FORMAT: formatString = "PGM"; plain = false; break; - case PPM_FORMAT: + case PPM_FORMAT: formatString = "PPM"; plain = TRUE; break; - case RPPM_FORMAT: + case RPPM_FORMAT: formatString = "PPM"; plain = false; break; } @@ -340,8 +340,8 @@ main(int argc, const char *argv[]) { cmdline.comments); pm_close(ifP); - } - } + } + } return 0; } diff --git a/analyzer/pamsharpmap.c b/analyzer/pamsharpmap.c index 2f31835b..f63760fe 100644 --- a/analyzer/pamsharpmap.c +++ b/analyzer/pamsharpmap.c @@ -14,7 +14,7 @@ No warranty. See file 'artistic.license' for more details. boris@13thmonkey.org - www.13thmonkey.org/~boris/photopnmtools/ + www.13thmonkey.org/~boris/photopnmtools/ -----------------------------------------------------------------------------*/ #include @@ -40,7 +40,7 @@ parseCommandLine ( int argc, char ** argv, struct cmdlineInfo *cmdlineP ) { /*---------------------------------------------------------------------------- parse program command line described in Unix standard form by argc - and argv. Return the information in the options as *cmdlineP. + and argv. Return the information in the options as *cmdlineP. If command line is internally inconsistent (invalid options, etc.), issue error message to stderr and abort program. @@ -58,7 +58,7 @@ parseCommandLine ( int argc, char ** argv, unsigned int contextSpec; option_def_index = 0; /* incremented by OPTENT3 */ - OPTENT3(0, "context", OPT_UINT, &cmdlineP->context, + OPTENT3(0, "context", OPT_UINT, &cmdlineP->context, &contextSpec, 0 ); opt.opt_table = option_def; @@ -92,7 +92,7 @@ makeSharpnessPixel(struct pam * const pamP, unsigned int plane; for (plane = 0; plane < pamP->depth; ++plane) - sharpnessTuple[plane] = + sharpnessTuple[plane] = (sample)(sharpness[plane] * pamP->maxval + 0.5); } @@ -132,20 +132,20 @@ main(int argc, char **argv) { int row; float * sharpness; - pnm_init(&argc, argv); + pnm_init(&argc, argv); parseCommandLine(argc, argv, &cmdline); ifP = pm_openr(cmdline.inputFilespec); - tuplenarray = pnm_readpamn(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); + tuplenarray = pnm_readpamn(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); mappam = inpam; mappam.file = stdout; mappam.maxval = 255; MALLOCARRAY_NOFAIL(sharpness, inpam.depth); - + map = pnm_allocpamarray(&mappam); makeBlackRown(&inpam, tuplenarray[0]); for (row = 1; row < inpam.height-1; ++row) { @@ -154,7 +154,7 @@ main(int argc, char **argv) { for (col = 1; col < inpam.width-1; ++col) { int dy; unsigned int plane; - + for (plane = 0; plane < inpam.depth; ++plane) sharpness[plane] = 0.0; @@ -164,9 +164,9 @@ main(int argc, char **argv) { if (dx != 0 || dy != 0) { unsigned int plane; for (plane = 0; plane < inpam.depth; ++plane) { - samplen const sampleval = + samplen const sampleval = tuplenarray[row][col][plane]; - samplen const sampleval2 = + samplen const sampleval2 = tuplenarray[row+dy][col+dx][plane]; sharpness[plane] += fabs(sampleval - sampleval2); } @@ -179,11 +179,11 @@ main(int argc, char **argv) { } makeBlackRown(&inpam, tuplenarray[inpam.height-1]); free(sharpness); - + pnm_writepam(&mappam, map); pnm_freepamarray(map, &mappam); - pnm_freepamarrayn(tuplenarray, &inpam); + pnm_freepamarrayn(tuplenarray, &inpam); - return 0; + return 0; } diff --git a/analyzer/pamsharpness.c b/analyzer/pamsharpness.c index 5943416f..f9140bcf 100644 --- a/analyzer/pamsharpness.c +++ b/analyzer/pamsharpness.c @@ -14,7 +14,7 @@ No warranty. See file 'artistic.license' for more details. boris@13thmonkey.org - www.13thmonkey.org/~boris/photopnmtools/ + www.13thmonkey.org/~boris/photopnmtools/ -----------------------------------------------------------------------------*/ #include @@ -40,7 +40,7 @@ parseCommandLine(int argc, char ** argv, struct cmdlineInfo *cmdlineP) { /*---------------------------------------------------------------------------- parse program command line described in Unix standard form by argc - and argv. Return the information in the options as *cmdlineP. + and argv. Return the information in the options as *cmdlineP. If command line is internally inconsistent (invalid options, etc.), issue error message to stderr and abort program. @@ -60,7 +60,7 @@ parseCommandLine(int argc, char ** argv, MALLOCARRAY_NOFAIL(option_def, 100); option_def_index = 0; /* incremented by OPTENT3 */ - OPTENT3(0, "context", OPT_UINT, &cmdlineP->context, + OPTENT3(0, "context", OPT_UINT, &cmdlineP->context, &contextSpec, 0 ); opt.opt_table = option_def; @@ -96,7 +96,7 @@ computeSharpness(struct pam * const inpamP, unsigned int row; double totsharp; - + totsharp = 0.0; for (row = 1; row < inpamP->height-1; ++row) { @@ -109,18 +109,18 @@ computeSharpness(struct pam * const inpamP, if (dx != 0 || dy != 0) { unsigned int plane; for (plane = 0; plane < inpamP->depth; ++plane) { - samplen const sampleval = + samplen const sampleval = tuplenarray[row][col][plane]; - samplen const sampleval2 = + samplen const sampleval2 = tuplenarray[row+dy][col+dx][plane]; totsharp += fabs(sampleval - sampleval2); } } } } - } - } - *sharpnessP = + } + } + *sharpnessP = totsharp / (inpamP->width * inpamP->height * inpamP->depth * 8); /* The 8 above is for the 8 neighbors to which we compare each pixel */ } @@ -136,13 +136,13 @@ main(int argc, char **argv) { struct pam inpam; double sharpness; - pnm_init(&argc, argv); + pnm_init(&argc, argv); parseCommandLine(argc, argv, &cmdline); ifP = pm_openr(cmdline.inputFilespec); - tuplenarray = pnm_readpamn(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); + tuplenarray = pnm_readpamn(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); if (inpam.height < 3 || inpam.width < 3) pm_error("sharpness is undefined for an image less than 3 pixels " @@ -153,8 +153,8 @@ main(int argc, char **argv) { printf("Sharpness = %f\n", sharpness); - pnm_freepamarrayn(tuplenarray, &inpam); + pnm_freepamarrayn(tuplenarray, &inpam); pm_close(ifP); - return 0; + return 0; } diff --git a/analyzer/pamslice.c b/analyzer/pamslice.c index db0ab9c0..5bdbea10 100644 --- a/analyzer/pamslice.c +++ b/analyzer/pamslice.c @@ -1,4 +1,4 @@ -/* +/* * * This program (Pamslice) was derived by Bryan Henderson in July 2002 * from Pgmslice by Jos Dingjan. Pgmslice did the same thing, but @@ -10,10 +10,10 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -77,12 +77,12 @@ parseCommandLine(int argc, char ** const argv, if (argc-1 > 1) pm_error("Too many arguments (%d). Only argument is filename.", argc-1); - else if (argc-1 == 1) + else if (argc-1 == 1) cmdlineP->inputFilespec = argv[1]; else cmdlineP->inputFilespec = "-"; - if (rowSpec) + if (rowSpec) cmdlineP->orientation = ROW; else if (colSpec) cmdlineP->orientation = COLUMN; @@ -121,7 +121,7 @@ printSlice(FILE * const outfile, else fprintf(stdout,"@ type nxy\n"); } - + count = 0; for (row = rowstart; row < rowend; ++row) { unsigned int col; @@ -137,7 +137,7 @@ printSlice(FILE * const outfile, -int +int main(int argc, char *argv[]) { struct cmdlineInfo cmdline; @@ -177,7 +177,7 @@ main(int argc, char *argv[]) { break; } - + if (cmdline.onePlane) { if (cmdline.plane >= inpam.depth) pm_error("You specified plane %u, but there are only %u planes " @@ -189,12 +189,12 @@ main(int argc, char *argv[]) { planeend = inpam.depth; } - printSlice(stdout, tuples, + printSlice(stdout, tuples, rowstart, rowend, colstart, colend, planestart, planeend, cmdline.xmgr); pm_close(ifP); pm_close(stdout); - + exit(0); } diff --git a/analyzer/pbmminkowski.c b/analyzer/pbmminkowski.c index 0f7b47a9..368ff34e 100644 --- a/analyzer/pbmminkowski.c +++ b/analyzer/pbmminkowski.c @@ -25,15 +25,15 @@ int main(int argc, const char ** argv) { bit * prevrow; bit * thisrow; bit * tmprow; - + int row; - int col; + int col; int countTile; int countEdgeX; int countEdgeY; int countVertex; - + int rows; int cols; int format; @@ -42,15 +42,15 @@ int main(int argc, const char ** argv) { pm_proginit(&argc, argv); - + if (argc > 2) pm_usage("[pbmfile]"); - + if (argc == 2) ifP = pm_openr(argv[1]); else ifP = stdin; - + pbm_readpbminit(ifP, &cols, &rows, &format); prevrow = pbm_allocrow(cols); @@ -68,10 +68,10 @@ int main(int argc, const char ** argv) { /* tiles */ - for (col = 0; col < cols; ++col) + for (col = 0; col < cols; ++col) if (ISWHITE(thisrow[col])) ++countTile; - + /* shortcut: for the first row, edgeY == countTile */ countEdgeY = countTile; @@ -80,7 +80,7 @@ int main(int argc, const char ** argv) { if (ISWHITE(thisrow[0])) ++countEdgeX; - for (col = 0; col < cols-1; ++col) + for (col = 0; col < cols-1; ++col) if (ISWHITE(thisrow[col]) || ISWHITE(thisrow[col+1])) ++countEdgeX; @@ -88,56 +88,56 @@ int main(int argc, const char ** argv) { ++countEdgeX; /* shortcut: for the first row, countVertex == countEdgeX */ - + countVertex = countEdgeX; - - for (row = 1; row < rows; ++row) { - - tmprow = prevrow; + + for (row = 1; row < rows; ++row) { + + tmprow = prevrow; prevrow = thisrow; thisrow = tmprow; - + pbm_readpbmrow(ifP, thisrow, cols, format); - + /* tiles */ - for (col = 0; col < cols; ++col) + for (col = 0; col < cols; ++col) if (ISWHITE(thisrow[col])) ++countTile; - + /* y-edges */ - for (col = 0; col < cols; ++col) + for (col = 0; col < cols; ++col) if (ISWHITE(thisrow[col]) || ISWHITE(prevrow[col])) ++countEdgeY; - + /* x-edges */ if (ISWHITE(thisrow[0])) ++countEdgeX; - for (col = 0; col < cols-1; ++col) + for (col = 0; col < cols-1; ++col) if (ISWHITE(thisrow[col]) || ISWHITE(thisrow[col+1])) ++countEdgeX; - + if (ISWHITE(thisrow[cols-1])) ++countEdgeX; - + /* vertices */ if (ISWHITE(thisrow[0]) || ISWHITE(prevrow[0])) ++countVertex; - for (col = 0; col < cols-1; ++col) - if (ISWHITE(thisrow[col]) || ISWHITE(thisrow[col+1]) + for (col = 0; col < cols-1; ++col) + if (ISWHITE(thisrow[col]) || ISWHITE(thisrow[col+1]) || ISWHITE(prevrow[col]) || ISWHITE(prevrow[col+1])) ++countVertex; if (ISWHITE(thisrow[cols-1]) || ISWHITE(prevrow[cols-1])) ++countVertex; - + } /* for row */ /* now thisrow contains the top row*/ @@ -145,19 +145,19 @@ int main(int argc, const char ** argv) { vertices remain */ - + /* y-edges */ - for (col = 0; col < cols; ++col) + for (col = 0; col < cols; ++col) if (ISWHITE(thisrow[col])) ++countEdgeY; /* vertices */ - + if (ISWHITE(thisrow[0])) ++countVertex; - for (col = 0; col < cols-1; ++col) + for (col = 0; col < cols-1; ++col) if (ISWHITE(thisrow[col]) || ISWHITE(thisrow[col+1])) ++countVertex; @@ -179,7 +179,7 @@ int main(int argc, const char ** argv) { printf(" area:\t%d\nperimeter:\t%d\n eulerchi:\t%d\n", area, perimeter, eulerchi ); - + return 0; } diff --git a/analyzer/pgmhist.c b/analyzer/pgmhist.c index 1e779655..a85f0649 100644 --- a/analyzer/pgmhist.c +++ b/analyzer/pgmhist.c @@ -211,8 +211,8 @@ findQuantiles(unsigned int const n, cumCt = hist[0]; /* initial value */ for (quantSeq = 1; quantSeq <= n; ++quantSeq) { - unsigned long int const q = totalCt / n; - unsigned long int const r = totalCt % n; + unsigned long int const q = totalCt / n; + unsigned long int const r = totalCt % n; unsigned long int const quantCt = q*quantSeq + (r*quantSeq + n - 1)/n; /* This is how many pixels are (ignoring quantization) in the quantile. E.g. for the 3rd quartile, it is 3/4 of the pixels @@ -419,7 +419,7 @@ summarizeInvalidPixels(unsigned long int const hist[], Print total count of valid and invalid pixels, if there are any invalid ones. -----------------------------------------------------------------------------*/ - unsigned long int const invalidPixelCt = + unsigned long int const invalidPixelCt = mmaxval > maxval ? rcount[maxval+1] : 0; if (invalidPixelCt > 0) { diff --git a/analyzer/pgmminkowski.c b/analyzer/pgmminkowski.c index dfb08429..676dd567 100644 --- a/analyzer/pgmminkowski.c +++ b/analyzer/pgmminkowski.c @@ -1,9 +1,9 @@ -/* pgmminkowsky.c - read a portable graymap and calculate the Minkowski +/* pgmminkowsky.c - read a portable graymap and calculate the Minkowski ** Integrals as a function of the threshold. ** ** Copyright (C) 2000 by Luuk van Dijk/Mind over Matter ** -** Based on pgmhist.c, +** Based on pgmhist.c, ** Copyright (C) 1989 by Jef Poskanzer. ** ** Permission to use, copy, modify, and distribute this software and its @@ -22,7 +22,7 @@ #define MAX4(a,b,c,d) MAX2( MAX2((a),(b)), MAX2((c),(d)) ) int main( int argc, char** argv ){ - + FILE *ifp; gray maxval; @@ -31,11 +31,11 @@ int main( int argc, char** argv ){ gray* prevrow; gray* thisrow; gray* tmprow; - - int* countTile; - int* countEdgeX; - int* countEdgeY; - int* countVertex; + + int* countTile; + int* countEdgeX; + int* countEdgeY; + int* countVertex; int i, col, row; @@ -46,12 +46,12 @@ int main( int argc, char** argv ){ /* * parse arg and initialize - */ + */ pgm_init( &argc, argv ); if ( argc > 2 ) pm_usage( "[pgmfile]" ); - + if ( argc == 2 ) ifp = pm_openr( argv[1] ); else @@ -62,19 +62,19 @@ int main( int argc, char** argv ){ */ pgm_readpgminit( ifp, &cols, &rows, &maxval, &format ); - + prevrow = pgm_allocrow( cols ); thisrow = pgm_allocrow( cols ); - + MALLOCARRAY(countTile , maxval + 1 ); MALLOCARRAY(countEdgeX , maxval + 1 ); MALLOCARRAY(countEdgeY , maxval + 1 ); MALLOCARRAY(countVertex , maxval + 1 ); - + if (countTile == NULL || countEdgeX == NULL || countEdgeY == NULL || countVertex == NULL) pm_error( "out of memory" ); - + for ( i = 0; i <= maxval; i++ ) countTile[i] = 0; for ( i = 0; i <= maxval; i++ ) countEdgeX[i] = 0; for ( i = 0; i <= maxval; i++ ) countEdgeY[i] = 0; @@ -89,84 +89,84 @@ int main( int argc, char** argv ){ /* tiles */ - for ( col = 0; col < cols; ++col ) ++countTile[thisrow[col]]; - + for ( col = 0; col < cols; ++col ) ++countTile[thisrow[col]]; + /* y-edges */ - for ( col = 0; col < cols; ++col ) ++countEdgeY[thisrow[col]]; + for ( col = 0; col < cols; ++col ) ++countEdgeY[thisrow[col]]; /* x-edges */ ++countEdgeX[thisrow[0]]; - for ( col = 0; col < cols-1; ++col ) + for ( col = 0; col < cols-1; ++col ) ++countEdgeX[ MAX2(thisrow[col], thisrow[col+1]) ]; - + ++countEdgeX[thisrow[cols-1]]; - + /* shortcut: for the first row, countVertex == countEdgeX */ - + ++countVertex[thisrow[0]]; - for ( col = 0; col < cols-1; ++col ) + for ( col = 0; col < cols-1; ++col ) ++countVertex[ MAX2(thisrow[col], thisrow[col+1]) ]; ++countVertex[thisrow[cols-1]]; - - for ( row = 1; row < rows; ++row ){ - - tmprow = prevrow; + + for ( row = 1; row < rows; ++row ){ + + tmprow = prevrow; prevrow = thisrow; thisrow = tmprow; - + pgm_readpgmrow( ifp, thisrow, cols, maxval, format ); - + /* tiles */ - for ( col = 0; col < cols; ++col ) ++countTile[thisrow[col]]; - + for ( col = 0; col < cols; ++col ) ++countTile[thisrow[col]]; + /* y-edges */ - - for ( col = 0; col < cols; ++col ) + + for ( col = 0; col < cols; ++col ) ++countEdgeY[ MAX2(thisrow[col], prevrow[col]) ]; /* x-edges */ - + ++countEdgeX[thisrow[0]]; - - for ( col = 0; col < cols-1; ++col ) + + for ( col = 0; col < cols-1; ++col ) ++countEdgeX[ MAX2(thisrow[col], thisrow[col+1]) ]; - + ++countEdgeX[thisrow[cols-1]]; - + /* vertices */ ++countVertex[ MAX2(thisrow[0],prevrow[0]) ]; - for ( col = 0; col < cols-1; ++col ) + for ( col = 0; col < cols-1; ++col ) ++countVertex[ MAX4(thisrow[col], thisrow[col+1], prevrow[col], prevrow[col+1]) ]; - + ++countVertex[ MAX2(thisrow[cols-1],prevrow[cols-1]) ]; - + } /* for row */ - + /* now thisrow contains the top row*/ /* tiles and x-edges have been counted, now upper y-edges and top vertices remain */ - + /* y-edges */ for ( col = 0; col < cols; ++col ) ++countEdgeY[ thisrow[col] ]; /* vertices */ - + ++countVertex[thisrow[0]]; - for ( col = 0; col < cols-1; ++col ) + for ( col = 0; col < cols-1; ++col ) ++countVertex[ MAX2(thisrow[col],thisrow[col+1]) ]; ++countVertex[ thisrow[cols-1] ]; @@ -178,7 +178,7 @@ int main( int argc, char** argv ){ maxedgex = rows * (cols+1); maxedgey = (rows+1) * cols; maxvertex= (rows+1) * (cols+1); - + l2inv = 1.0/maxtiles; linv = 0.5/(rows+cols); @@ -187,14 +187,14 @@ int main( int argc, char** argv ){ printf( "#---------\t -----\t-------\t-------\t--------\n" ); for ( i = 0; i <= maxval; i++ ){ - if( !(countTile[i] || countEdgeX[i] || countEdgeY[i] || countVertex[i] ) ) + if( !(countTile[i] || countEdgeX[i] || countEdgeY[i] || countVertex[i] ) ) continue; /* skip empty slots */ area = maxtiles; perimeter = 2*maxedgex + 2*maxedgey - 4*maxtiles; eulerchi = maxtiles - maxedgex - maxedgey + maxvertex; - printf( "%f\t%6d\t%7d\t%7d\t%8d\t%g\t%g\t%6d\n", (float) i/(1.0*maxval), + printf( "%f\t%6d\t%7d\t%7d\t%8d\t%g\t%g\t%6d\n", (float) i/(1.0*maxval), maxtiles, maxedgex, maxedgey, maxvertex, area*l2inv, perimeter*linv, eulerchi ); @@ -210,13 +210,13 @@ int main( int argc, char** argv ){ } /* these should be zero: */ - printf( "# check:\t%6d\t%7d\t%7d\t%8d\n", + printf( "# check:\t%6d\t%7d\t%7d\t%8d\n", maxtiles, maxedgex, maxedgey, maxvertex ); pm_close( ifp ); - + exit( 0 ); - + } /*main*/ diff --git a/analyzer/pnmhistmap.c b/analyzer/pnmhistmap.c index fc1bbbde..e51bbb24 100644 --- a/analyzer/pnmhistmap.c +++ b/analyzer/pnmhistmap.c @@ -113,7 +113,7 @@ parseCommandLine(int argc, const char ** argv, if (!heightSpec) cmdlineP->height = 200; - if (argc-1 == 0) + if (argc-1 == 0) cmdlineP->inputFilespec = "-"; else if (argc-1 != 1) pm_error("Program takes zero or one argument (filename). You " @@ -202,7 +202,7 @@ pgmHist(FILE * const ifP, unsigned int * ghist; double vscale; unsigned int hmax; - + MALLOCARRAY(ghist, histWidth); if (ghist == NULL) pm_error("Not enough memory for histogram array (%u bytes)", @@ -231,7 +231,7 @@ pgmHist(FILE * const ifP, pm_message("finding max. slot height..."); if (clipSpec) hmax = clipCount; - else + else hmax = maxSlotCount(ghist, histWidth, no_white, no_black); assert(hmax > 0); @@ -275,10 +275,10 @@ maxSlotCountAll(unsigned int * const hist[3], for (color = 0; color < 3; ++color) if (hist[color]) - hmax = MAX(hmax, - maxSlotCount(hist[color], + hmax = MAX(hmax, + maxSlotCount(hist[color], histWidth, no_white, no_black)); - + return hmax; } @@ -418,7 +418,7 @@ ppmHist(FILE * const ifP, pm_message("finding max. slot height..."); if (clipSpec) hmax = clipCount; - else + else hmax = maxSlotCountAll(hist, histWidth, no_white, no_black); assert(hmax > 0); @@ -427,7 +427,7 @@ ppmHist(FILE * const ifP, vscale = (double) histHeight / hmax; if (verbose && pm_have_float_format()) - pm_message("Done: height = %u, vertical scale factor = %g", + pm_message("Done: height = %u, vertical scale factor = %g", hmax, vscale); for (i = 0; i < histWidth; ++i) { @@ -435,8 +435,8 @@ ppmHist(FILE * const ifP, unsigned int j; bool plotted; plotted = FALSE; - for (j = histHeight - (int)(vscale * hist[WANT_RED][i]); - j < histHeight && !plotted; + for (j = histHeight - (int)(vscale * hist[WANT_RED][i]); + j < histHeight && !plotted; ++j) { PPM_PUTR(pixels[j][i], maxval); plotted = dots; @@ -446,8 +446,8 @@ ppmHist(FILE * const ifP, unsigned int j; bool plotted; plotted = FALSE; - for (j = histHeight - (int)(vscale * hist[WANT_GRN][i]); - j < histHeight && !plotted; + for (j = histHeight - (int)(vscale * hist[WANT_GRN][i]); + j < histHeight && !plotted; ++j) { PPM_PUTG(pixels[j][i], maxval); plotted = dots; @@ -457,8 +457,8 @@ ppmHist(FILE * const ifP, unsigned int j; bool plotted; plotted = FALSE; - for (j = histHeight - (int)(vscale * hist[WANT_BLU][i]); - j < histHeight && !plotted; + for (j = histHeight - (int)(vscale * hist[WANT_BLU][i]); + j < histHeight && !plotted; ++j) { PPM_PUTB(pixels[j][i], maxval); plotted = dots; -- cgit 1.4.1