diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-03-28 01:55:27 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2013-03-28 01:55:27 +0000 |
commit | 200553b6135e1ba6a4b6585e3d07d934ba6b8ceb (patch) | |
tree | 0d7a730843db22ff539ed39feddd3b7d3e4541f1 /generator | |
parent | 5240773e57f21c778d227fd14a3720006f70c83e (diff) | |
download | netpbm-mirror-200553b6135e1ba6a4b6585e3d07d934ba6b8ceb.tar.gz netpbm-mirror-200553b6135e1ba6a4b6585e3d07d934ba6b8ceb.tar.xz netpbm-mirror-200553b6135e1ba6a4b6585e3d07d934ba6b8ceb.zip |
Update advanced series to 10.62
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@1869 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'generator')
-rw-r--r-- | generator/pamstereogram.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/generator/pamstereogram.c b/generator/pamstereogram.c index ac71c702..6bcababa 100644 --- a/generator/pamstereogram.c +++ b/generator/pamstereogram.c @@ -762,10 +762,10 @@ drawguides(unsigned int const guidesize, /*---------------------------------------------------------------------------- Draw a pair of guide boxes, left and right. -----------------------------------------------------------------------------*/ - int const far = separation(0, eyesep, dpi, depthOfField); + unsigned int const far = separation(0, eyesep, dpi, depthOfField); /* Space between the two guide boxes. */ - int const width = outPamP->width; /* Width of the output image */ - + unsigned int const width = outPamP->width; /* Width of the output image */ + tuple * outrow; /* One row of output data */ tuple blackTuple; unsigned int col; @@ -874,8 +874,8 @@ makeStereoRow(const struct pam * const inPamP, } while (visible && zt < 1); if (visible) { - int l; - + unsigned int l; + l = same[left]; while (l != left && l != right) { if (l < right) { @@ -979,18 +979,20 @@ averageFromPattern(struct pam * const pamP, every column that should have the same color. */ for (col = pamP->width-1; col >= 0; --col) { - tuple onetuple = textureRow[(col+same[col])/2]; - int targetcol = sameFp[col]; + tuple const onetuple = textureRow[(col+same[col])/2]; + unsigned int const targetcol = sameFp[col]; int eqcol; - if (!pnm_tupleequal(pamP, onetuple, bgColor)) - for (eqcol = pamP->width-1; eqcol >= 0; --eqcol) + if (!pnm_tupleequal(pamP, onetuple, bgColor)) { + for (eqcol = pamP->width-1; eqcol >= 0; --eqcol) { if (sameFp[eqcol] == targetcol) { unsigned int plane; for (plane = 0; plane < pamP->depth; ++plane) outRow[eqcol][plane] += onetuple[plane]; tuplesInCol[eqcol]++; } + } + } } /* Take the average of all colors associated with each column. Tuples that can be any color are assigned the same color as was |