diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-03-26 02:53:02 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2020-03-26 02:53:02 +0000 |
commit | b117a415aaf58c435805243a930e833f8cf62421 (patch) | |
tree | ca6cda4c24d37737a3942e534b95006bcd566c5a /other/pamunlookup.c | |
parent | 34bb24c566c9d9fe3c4ae71fc4c6b53323fb1dd9 (diff) | |
download | netpbm-mirror-b117a415aaf58c435805243a930e833f8cf62421.tar.gz netpbm-mirror-b117a415aaf58c435805243a930e833f8cf62421.tar.xz netpbm-mirror-b117a415aaf58c435805243a930e833f8cf62421.zip |
Promote trunk (10.90.00) to advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3784 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'other/pamunlookup.c')
-rw-r--r-- | other/pamunlookup.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/other/pamunlookup.c b/other/pamunlookup.c index 77c2807b..624951df 100644 --- a/other/pamunlookup.c +++ b/other/pamunlookup.c @@ -49,13 +49,13 @@ parseCommandLine(int argc, const char ** const argv, optStruct3 opt; unsigned int option_def_index; - + unsigned int lookupfileSpec; MALLOCARRAY_NOFAIL(option_def, 100); option_def_index = 0; /* incremented by OPTENTRY */ - OPTENT3(0, "lookupfile", OPT_STRING, &cmdlineP->lookupfile, + OPTENT3(0, "lookupfile", OPT_STRING, &cmdlineP->lookupfile, &lookupfileSpec, 0); opt.opt_table = option_def; @@ -74,17 +74,17 @@ parseCommandLine(int argc, const char ** const argv, cmdlineP->inputFileName = argv[1]; free(option_def); -} +} static void -getLookup(const char * const lookupFileName, +getLookup(const char * const lookupFileName, tuple *** const lookupP, struct pam * const lookuppamP) { /*---------------------------------------------------------------------------- Get the lookup image (the one that maps integers to tuples, e.g. a - color index / color map / palette) from the file named + color index / color map / palette) from the file named 'lookupFileName'. Return the image as *lookupP and *lookuppamP. @@ -95,14 +95,14 @@ getLookup(const char * const lookupFileName, tuple ** inputLookup; lookupfileP = pm_openr(lookupFileName); - inputLookup = pnm_readpam(lookupfileP, + inputLookup = pnm_readpam(lookupfileP, &inputLookuppam, PAM_STRUCT_SIZE(tuple_type)); pm_close(lookupfileP); - + if (inputLookuppam.height != 1) pm_error("The lookup table image must be one row. " - "Yours is %u rows.", + "Yours is %u rows.", inputLookuppam.height); *lookupP = inputLookup; @@ -129,7 +129,7 @@ makeReverseLookupHash(struct pam * const lookuppamP, for (col = 0; col < lookuppamP->width; ++col) { tuple const thisValue = lookup[0][col]; - + int found; int priorValue; @@ -181,7 +181,7 @@ doUnlookup(struct pam * const inpamP, for (row = 0; row < inpamP->height; ++row) { unsigned int col; - + pnm_readpamrow(inpamP, inrow); for (col = 0; col < inpamP->width; ++col) { @@ -214,7 +214,7 @@ main(int argc, const char ** const argv) { tuple ** lookup; tuplehash lookupHash; - + pm_proginit(&argc, argv); parseCommandLine(argc, argv, &cmdline); @@ -230,7 +230,7 @@ main(int argc, const char ** const argv) { "has depth %u. They must be the same", lookuppam.depth, inpam.depth); if (!streq(inpam.tuple_type, lookuppam.tuple_type)) - pm_error("The lookup image has tupel type '%s', " + pm_error("The lookup image has tuple type '%s', " "but the input image " "has tuple type '%s'. They must be the same", lookuppam.tuple_type, inpam.tuple_type); @@ -243,7 +243,7 @@ main(int argc, const char ** const argv) { pnm_destroytuplehash(lookupHash); pnm_freepamarray(lookup, &lookuppam); - + return 0; } |