diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2012-12-04 17:01:18 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2012-12-04 17:01:18 +0000 |
commit | e25552d8ec73ac0d19ea5c3c4cad34928f952de8 (patch) | |
tree | a9c1d639032ed54949e72d0e461d3cd82d9ed0f7 /editor/pnmmontage.c | |
parent | 0c19d160d0d0cba6ff7fd5a67e704ead2296c3c4 (diff) | |
download | netpbm-mirror-e25552d8ec73ac0d19ea5c3c4cad34928f952de8.tar.gz netpbm-mirror-e25552d8ec73ac0d19ea5c3c4cad34928f952de8.tar.xz netpbm-mirror-e25552d8ec73ac0d19ea5c3c4cad34928f952de8.zip |
Release 10.60.04
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@1798 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/pnmmontage.c')
-rw-r--r-- | editor/pnmmontage.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/editor/pnmmontage.c b/editor/pnmmontage.c index 77425760..8016fd77 100644 --- a/editor/pnmmontage.c +++ b/editor/pnmmontage.c @@ -108,7 +108,7 @@ parseCommandLine(int argc, const char ** argv, pm_error("Filename '%s' contains a \":\", which is forbidden " "with -data", argv[i+1]); else - cmdlineP->inFileName[i] = strdup(argv[1+1]); + cmdlineP->inFileName[i] = strdup(argv[i+1]); } } @@ -366,6 +366,21 @@ adjustMaxval(tuple * const tuplerow, static void +makeRowBlack(struct pam * const pamP, + tuple * const tuplerow) { + + unsigned int col; + + for (col = 0; col < pamP->width; ++col) { + unsigned int plane; + for (plane = 0; plane < pamP->depth; ++plane) + tuplerow[col][plane] = 0; + } +} + + + +static void writePam(struct pam * const outpamP, unsigned int const nfiles, const coord * const coords, @@ -380,6 +395,9 @@ writePam(struct pam * const outpamP, for (i = 0; i < outpamP->height; ++i) { int j; + + makeRowBlack(outpamP, tuplerow); /* initial value */ + for (j = 0; j < nfiles; ++j) { if (coords[j].y <= i && i < coords[j].y + imgs[j].height) { pnm_readpamrow(&imgs[j], &tuplerow[coords[j].x]); @@ -631,11 +649,10 @@ main(int argc, const char **argv) { pnm_setminallocationdepth(&outimg, outimg.depth); outimg.size = sizeof(outimg); - outimg.len = sizeof(outimg); + outimg.len = PAM_STRUCT_SIZE(allocation_depth); + pnm_setminallocationdepth(&outimg, outimg.depth); + outimg.plainformat = false; outimg.file = stdout; - outimg.bytes_per_sample = 0; - for (i = outimg.maxval; i; i >>= 8) - ++outimg.bytes_per_sample; writePam(&outimg, nfiles, coords, imgs); |