diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-08 17:45:23 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-10-08 17:45:23 +0000 |
commit | bb4ba2586d4cfe9302278a427ee4cf7a89aef53b (patch) | |
tree | e48d17b2acafd26e2367c33d96d56cf58eb1f858 /converter/other/pamtohdiff.c | |
parent | 4b091760fddc73ffc877563b445599db21557e78 (diff) | |
download | netpbm-mirror-bb4ba2586d4cfe9302278a427ee4cf7a89aef53b.tar.gz netpbm-mirror-bb4ba2586d4cfe9302278a427ee4cf7a89aef53b.tar.xz netpbm-mirror-bb4ba2586d4cfe9302278a427ee4cf7a89aef53b.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4736 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pamtohdiff.c')
-rw-r--r-- | converter/other/pamtohdiff.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/converter/other/pamtohdiff.c b/converter/other/pamtohdiff.c index 8d785f5b..d28cdb14 100644 --- a/converter/other/pamtohdiff.c +++ b/converter/other/pamtohdiff.c @@ -64,7 +64,7 @@ parseCommandLine(int argc, char ** argv, -int +int main(int argc, char *argv[]) { FILE *ifP; struct cmdlineInfo cmdline; @@ -106,7 +106,7 @@ main(int argc, char *argv[]) { knows the "20" can't be +20, because that would create the sample 90 + 20 = 110, and violate maxval. So it must be -80. Modulus arithmetic by the interpreter effectively makes that - decision. + decision. */ @@ -115,7 +115,7 @@ main(int argc, char *argv[]) { all +/- half of maxval, you can see positive transitions as bright spots and negative transitions as dark spots. */ - + { unsigned int const bias = outpam.maxval/2; for (row = 0; row < inpam.height; ++row) { @@ -124,7 +124,7 @@ main(int argc, char *argv[]) { for (col = 0; col < inpam.width; ++col) { unsigned int plane; for (plane = 0; plane < inpam.depth; ++plane) { - + sample const sampleValue = inrow[col][plane]; int const difference = sampleValue - prevrow[col][plane]; outrow[col][plane] = (difference + bias) % (outpam.maxval+1); @@ -141,3 +141,5 @@ main(int argc, char *argv[]) { exit(0); } + + |