diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2021-03-07 18:16:35 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2021-03-07 18:16:35 +0000 |
commit | bd6396245e3cb473527f378aa8436dbc519948df (patch) | |
tree | 29e35ea49ae1ecfaf1ef13b6230e429f5e2c1822 | |
parent | 3805f1245e1dd705e8a8cc4e384666dc4ae6a921 (diff) | |
download | netpbm-mirror-bd6396245e3cb473527f378aa8436dbc519948df.tar.gz netpbm-mirror-bd6396245e3cb473527f378aa8436dbc519948df.tar.xz netpbm-mirror-bd6396245e3cb473527f378aa8436dbc519948df.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4041 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | converter/other/pnmtopng.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/converter/other/pnmtopng.c b/converter/other/pnmtopng.c index 09b4d204..981ce6ce 100644 --- a/converter/other/pnmtopng.c +++ b/converter/other/pnmtopng.c @@ -899,7 +899,7 @@ meaningful_bits_ppm(FILE * const ifp, static void -tryTransparentColor(FILE * const ifp, +tryTransparentColor(FILE * const ifP, pm_filepos const rasterPos, int const cols, int const rows, @@ -909,7 +909,14 @@ tryTransparentColor(FILE * const ifp, gray const alphaMaxval, pixel const transcolor, bool * const singleColorIsTransP) { +/*---------------------------------------------------------------------------- + Find out if the transparent pixels identified by alpha mask 'alphaMask' + (whose maxval is 'alphaMaxval') are exactly the pixels of color + 'transcolor'. Return answer as *singleColorIsTransP. + The image we analyze is that on input stream *ifP, starting at position + 'rasterPos', and we leave that stream positioned arbitrarily. +-----------------------------------------------------------------------------*/ int const pnmType = PNM_FORMAT_TYPE(format); xel * xelrow; @@ -919,13 +926,13 @@ tryTransparentColor(FILE * const ifp, xelrow = pnm_allocrow(cols); - pm_seek2(ifp, &rasterPos, sizeof(rasterPos)); + pm_seek2(ifP, &rasterPos, sizeof(rasterPos)); singleColorIsTrans = true; /* initial assumption */ for (row = 0; row < rows && singleColorIsTrans; ++row) { int col; - pnm_readpnmrow(ifp, xelrow, cols, maxval, format); + pnm_readpnmrow(ifP, xelrow, cols, maxval, format); for (col = 0 ; col < cols && singleColorIsTrans; ++col) { if (alphaMask[row][col] == 0) { /* transparent */ /* If we have a second transparent color, we're |