From 553be9f71998e872838769b1a9be6972ab8ccb8e Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 20 Sep 2023 18:10:34 +0000 Subject: whitespace git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4672 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/libppm2.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'lib/libppm2.c') diff --git a/lib/libppm2.c b/lib/libppm2.c index 694ecdd7..b4690b71 100644 --- a/lib/libppm2.c +++ b/lib/libppm2.c @@ -19,22 +19,22 @@ #include "ppm.h" void -ppm_writeppminit(FILE* const fileP, - int const cols, - int const rows, - pixval const maxval, +ppm_writeppminit(FILE* const fileP, + int const cols, + int const rows, + pixval const maxval, int const forceplain) { bool const plainFormat = forceplain || pm_plain_output; - if (maxval > PPM_OVERALLMAXVAL && !plainFormat) + if (maxval > PPM_OVERALLMAXVAL && !plainFormat) pm_error("too-large maxval passed to ppm_writeppminit(): %d." "Maximum allowed by the PPM format is %d.", maxval, PPM_OVERALLMAXVAL); - fprintf(fileP, "%c%c\n%d %d\n%d\n", - PPM_MAGIC1, - plainFormat || maxval >= 1<<16 ? PPM_MAGIC2 : RPPM_MAGIC2, + fprintf(fileP, "%c%c\n%d %d\n%d\n", + PPM_MAGIC1, + plainFormat || maxval >= 1<<16 ? PPM_MAGIC2 : RPPM_MAGIC2, cols, rows, maxval ); } @@ -77,7 +77,7 @@ static void format2bpsRow(const pixel * const pixelrow, unsigned int const cols, unsigned char * const rowBuffer) { - + /* two byte samples. */ unsigned int col; @@ -89,7 +89,7 @@ format2bpsRow(const pixel * const pixelrow, pixval const r = PPM_GETR(pixelrow[col]); pixval const g = PPM_GETG(pixelrow[col]); pixval const b = PPM_GETB(pixelrow[col]); - + rowBuffer[bufferCursor++] = r >> 8; rowBuffer[bufferCursor++] = (unsigned char)r; rowBuffer[bufferCursor++] = g >> 8; @@ -176,31 +176,31 @@ ppm_writeppmrowplain(FILE * const fileP, void -ppm_writeppmrow(FILE * const fileP, - const pixel * const pixelrow, - int const cols, - pixval const maxval, +ppm_writeppmrow(FILE * const fileP, + const pixel * const pixelrow, + int const cols, + pixval const maxval, int const forceplain) { - if (forceplain || pm_plain_output || maxval >= 1<<16) + if (forceplain || pm_plain_output || maxval >= 1<<16) ppm_writeppmrowplain(fileP, pixelrow, cols, maxval); - else + else ppm_writeppmrowraw(fileP, pixelrow, cols, maxval); } void -ppm_writeppm(FILE * const file, - pixel** const pixels, - int const cols, - int const rows, - pixval const maxval, +ppm_writeppm(FILE * const file, + pixel** const pixels, + int const cols, + int const rows, + pixval const maxval, int const forceplain) { int row; - + ppm_writeppminit(file, cols, rows, maxval, forceplain); - + for (row = 0; row < rows; ++row) ppm_writeppmrow(file, pixels[row], cols, maxval, forceplain); } -- cgit 1.4.1