diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-08-08 20:48:16 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-08-08 20:48:16 +0000 |
commit | 618d37ef01a964cd322db0926b25be4702111486 (patch) | |
tree | 4eac44b47db9387d72891efaaa3949ba62158151 /editor | |
parent | 89bc85205463ed4eef7df54ff734580161da5892 (diff) | |
download | netpbm-mirror-618d37ef01a964cd322db0926b25be4702111486.tar.gz netpbm-mirror-618d37ef01a964cd322db0926b25be4702111486.tar.xz netpbm-mirror-618d37ef01a964cd322db0926b25be4702111486.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3908 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rw-r--r-- | editor/pnmnorm.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/editor/pnmnorm.c b/editor/pnmnorm.c index 20d7eb04..b566f56f 100644 --- a/editor/pnmnorm.c +++ b/editor/pnmnorm.c @@ -38,7 +38,7 @@ enum brightMethod {BRIGHT_LUMINOSITY, BRIGHT_COLORVALUE, BRIGHT_SATURATION}; -struct cmdlineInfo { +struct CmdlineInfo { /* All the information the user supplied in the command line, in a form easy for the program to use. */ @@ -70,7 +70,7 @@ struct cmdlineInfo { static void parseCommandLine(int argc, const char ** argv, - struct cmdlineInfo * const cmdlineP) { + struct CmdlineInfo * const cmdlineP) { /*---------------------------------------------------------------------------- parse program command line described in Unix standard form by argc and argv. Return the information in the options as *cmdlineP. @@ -265,7 +265,12 @@ buildHistogram(FILE * const ifp, static xelval minimumValue(const unsigned int * const hist, unsigned int const highest) { +/*---------------------------------------------------------------------------- + The minimum brightness in the image, according to histogram 'hist', + which goes up to 'highest'. + Abort the program if there are no pixels of any brightness. +-----------------------------------------------------------------------------*/ xelval i; bool foundOne; @@ -288,7 +293,12 @@ minimumValue(const unsigned int * const hist, static xelval maximumValue(const unsigned int * const hist, unsigned int const highest) { +/*---------------------------------------------------------------------------- + The maximum brightness in the image, according to histogram 'hist', + which goes up to 'highest'. + Abort the program if there are no pixels of any brightness. +-----------------------------------------------------------------------------*/ xelval i; bool foundOne; @@ -502,7 +512,7 @@ resolvePercentParams(FILE * const ifP, unsigned int const rows, xelval const maxval, int const format, - struct cmdlineInfo const cmdline, + struct CmdlineInfo const cmdline, xelval * const bvalueP, xelval * const wvalueP) { /*---------------------------------------------------------------------------- @@ -562,7 +572,7 @@ computeEndValues(FILE * const ifP, int const rows, xelval const maxval, int const format, - struct cmdlineInfo const cmdline, + struct CmdlineInfo const cmdline, xelval * const bvalueP, xelval * const wvalueP, bool * const quadraticP, @@ -629,7 +639,7 @@ computeLinearTransfer(xelval const bvalue, unsigned int val; /* The following for structure is a hand optimization of this one: for (i = bvalue; i <= wvalue; ++i) - newBrightness[i] = (i-bvalue)*maxval/range); + newBrightness[i] = (i-bvalue)*maxval/range); (with proper rounding) */ for (i = bvalue, val = range/2; @@ -937,8 +947,8 @@ reportTransferParm(bool const quadratic, int main(int argc, const char *argv[]) { - struct cmdlineInfo cmdline; - FILE *ifP; + struct CmdlineInfo cmdline; + FILE * ifP; pm_filepos imagePos; xelval maxval; int rows, cols, format; |