diff -cr pbmplus30oct91/CHANGES CHANGES *** pbmplus30oct91/CHANGES Wed Oct 30 13:03:49 1991 --- CHANGES Tue Dec 10 16:53:20 1991 *************** *** 1,3 **** --- 1,21 ---- + Changes since the 30oct91 patch version: + + Fixed uninitialized variable in ppmtotga. (John Walker) + Added pgmcrater, ppmforge, ppmtoacad, sldtoppm. (John Walker) + Slight change to the p?mmerge.c front-ends to allow for main programs + that return instead of exitting. + Minor clarifications to the pnmconvol man page. + Fixed xwdtopnm to read some 16-bit True/Direct files. (David Elliott) + Fixed uninitialized variables in pnmtotiff. (Larry Rosenstein, Bayles Holt) + Added a couple of checks for \r while reading whitespace. (Larry Rosenstein) + Removed all the BROKENPUTC stuff. Now we ignore all return values from + putc(), and check ferror() in pm_close(). Added pm_close() calls to + many of the filters. + Fixed pnmdepth to check for too-large newmaxvals. Improved rounding + in pnmdepth and PPM_DEPTH macro. (Tom Lane) + Minor fix to ppmtouil. (Mohsen Banan) + Added new Imakefiles. (Rainer Klute) + Changes since the 05oct91 X11R5 contrib tape version: Fixed minor SysV config error in pbmplus.h. (Tom Lane) diff -cr pbmplus30oct91/FORMATS FORMATS *** pbmplus30oct91/FORMATS Fri Sep 27 01:43:23 1991 --- FORMATS Tue Dec 10 16:53:22 1991 *************** *** 51,56 **** --- 51,58 ---- X11 "puzzle" file writing Motif UIL icon file writing DEC sixel format writing + AutoCAD slide format reading writing + AutoCAD DXB format writing PNM handles the following multi-type formats: diff -cr pbmplus30oct91/Makefile Makefile *** pbmplus30oct91/Makefile Wed Oct 30 20:13:49 1991 --- Makefile Tue Dec 10 16:53:27 1991 *************** *** 50,55 **** --- 50,58 ---- # Libtiff is pretty good about portability, but there are some machines # it has problems on. If you run into problems, you may wish to contact # Sam directly, at the address listed in the OTHER.SYSTEMS file. + # + # By the way, you must have at least version 2.4 of libtiff. Earlier + # versions will not work. TIFFDEF = -DLIBTIFF TIFFINC = -I../libtiff TIFFLIB = ../libtiff/libtiff.a diff -cr pbmplus30oct91/OTHER.SYSTEMS OTHER.SYSTEMS *** pbmplus30oct91/OTHER.SYSTEMS Wed Sep 18 20:03:52 1991 --- OTHER.SYSTEMS Tue Dec 10 16:53:22 1991 *************** *** 62,67 **** --- 62,77 ---- signal processing routines, and 2D/3D plotting packages. Available via FTP as pprg.unm.edu:pub/khoros/*. + LaboImage, a SunView-based image processing and analysis package. It + includes more than 200 image manipulation, processing and measurement + routines, on-line help, plus tools such as an image editor, a color + table editor and several biomedical utilities. Available via anonymous + FTP as ads.com:pub/VISION-LIST-ARCHIVE/SHAREWARE/LaboImage_3.1.tar.Z + + The San Diego Supercomputer Center Image Tools, software tools for + reading, writing, and manipulating raster images. Binaries for some + machines available via anonymous FTP in sdsc.edu:sdscpub. + Don't forget to set binary mode when you FTP tar files. For you MILNET folks who still don't have name servers, the IP addresses are: *************** *** 74,79 **** --- 84,91 ---- weedeater.math.yale.edu 130.132.23.17 freebie.engin.umich.edu 141.212.68.23 pprg.eece.unm.edu 129.24.24.10 + ads.com 128.229.30.16 + sdsc.edu 132.249.20.22 Also, the newsgroup alt.graphics.pixutils is specifically for discussion of software like this. You may find useful information there. diff -cr pbmplus30oct91/README README *** pbmplus30oct91/README Wed Oct 30 20:11:16 1991 --- README Tue Dec 10 16:53:18 1991 *************** *** 1,6 **** Extended Portable Bitmap Toolkit ! Distribution of 30oct91 ! Previous distribution 05oct91 PBMPLUS is a toolkit for converting various image formats to and from --- 1,6 ---- Extended Portable Bitmap Toolkit ! Distribution of 10dec91 ! Previous distribution 30oct91 PBMPLUS is a toolkit for converting various image formats to and from *************** *** 40,49 **** Make. When you're happy that things compiled ok, make install. ! The Imakefiles are pretty minimal, but if you want to use them anyway: ! Edit pbmplus.h, find each line with the string "CONFIGURE", and ! follow the directions for setting configuration options. Save the original Makefiles, in case you later want to switch back to using them. The usual X11 sequence of xmkmf, make Makefiles, make depend, then --- 40,50 ---- Make. When you're happy that things compiled ok, make install. ! If you want to use Imakefiles: ! Edit Pbmplus.tmpl, find each line with the string "CONFIGURE", ! and follow the directions for setting configuration options. ! Likewise edit pbmplus.h. Save the original Makefiles, in case you later want to switch back to using them. The usual X11 sequence of xmkmf, make Makefiles, make depend, then *************** *** 65,71 **** enhancements, etc. to this address: jef@well.sf.ca.us ! {apple, ucbvax}!well!jef When sending bug reports, always include the output from running any PBMPLUS program with the -version flag. Also include the type of --- 66,72 ---- enhancements, etc. to this address: jef@well.sf.ca.us ! apple!well!jef When sending bug reports, always include the output from running any PBMPLUS program with the -version flag. Also include the type of *************** *** 135,140 **** --- 136,143 ---- OTHER.SYSTEMS list of other free image-processing software Makefile guess Imakefile for X11-type installations + Imakefile.tiff for X11-type installations + Pbmplus.tmpl for X11-type installations pbmplus.h header file for PBM, PGM, PPM, and PNM compat.csh csh script for compatibility with old versions *************** *** 216,221 **** --- 219,225 ---- pgmtopbm.c convert portable graymap to portable bitmap pgmbentley.c Bentleyize a portable graymap + pgmcrater.c create cratered terrain by fractal forgery pgmedge.c edge-detect a portable graymap pgmenhance.c edge-enhance a portable graymap pgmhist.c print a histogram of the values in a portable graymap *************** *** 251,256 **** --- 255,261 ---- qrttoppm.c convert QRT ray-tracer output to portable pixmap rawtoppm.c convert raw RGB bytes to portable pixmap rgb3toppm.c combine three portable graymaps into one portable pixmap + sldtoppm.c convert an AutoCAD slide file into a portable pixmap spctoppm.c convert Atari compressed Spectrum to portable pixmap sputoppm.c convert Atari uncompressed Spectrum to portable pixmap tgatoppm.c convert TrueVision Targa file to portable pixmap *************** *** 258,263 **** --- 263,269 ---- xpmtoppm.c convert XPM format to portable pixmap yuvtoppm.c convert Abekas YUV format to portable pixmap + ppmtoacad.c convert portable pixmap to AutoCAD database or slide ppmtogif.c convert portable pixmap to GIF ppmtoicr.c convert portable pixmap to NCSA ICR graphics ppmtoilbm.c convert portable pixmap to IFF ILBM *************** *** 275,281 **** --- 281,289 ---- ppmtoyuv.c convert portable pixmap to Abekas YUV format ppmdither.c ordered dither for color images + ppmforge.c fractal forgeries of clouds, planets, and starry skies ppmhist.c print a histogram of a portable pixmap + ppmmake.c create a pixmap of a specified size and color ppmpat.c create a pretty pixmap ppmquant.c quantize colors down to a specified number ppmquantall script to run ppmquant on a set of pixmaps *************** *** 287,292 **** --- 295,301 ---- ppmcmap.h header file for colormap routines in libppm ppmdraw.h header file for simple drawing routines in libppm libppm.h internal header file for libppm + autocad.h definitions for AutoCAD files tga.h definitions for TrueVision Targa files xim.h definitions for Xim files *.1 manual entries for all of the tools diff -cr pbmplus30oct91/pbmplus.h pbmplus.h *** pbmplus30oct91/pbmplus.h Sun Oct 6 09:32:33 1991 --- pbmplus.h Tue Dec 10 16:53:28 1991 *************** *** 17,27 **** #include #include ! #if ! ( defined(BSD) || defined(SYSV) || defined(MSDOS)) /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a ** System V site, set the SYSV option; and if you're IBM-compatible, set ** MSDOS. If your compiler is ANSI C, you're probably better off setting ! ** SYSV. */ #define BSD /* #define SYSV */ --- 17,30 ---- #include #include ! #if defined(USG) || defined(SVR4) ! #define SYSV ! #endif ! #if ! ( defined(BSD) || defined(SYSV) || defined(MSDOS) ) /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a ** System V site, set the SYSV option; and if you're IBM-compatible, set ** MSDOS. If your compiler is ANSI C, you're probably better off setting ! ** SYSV - all it affects is string handling. */ #define BSD /* #define SYSV */ *************** *** 36,62 **** ** Note that reading "raw" files works whether writing is enabled or not. */ #define PBMPLUS_RAWBITS - - /* CONFIGURE: On some systems, the putc() macro is broken and will return - ** EOF when you write out a 255. For example, ULTRIX does this. This - ** only matters if you have defined RAWBITS. To test whether your system - ** is broken this way, go ahead and compile things with RAWBITS defined, - ** and then try "pbmmake -b 8 1 > file". If it works, fine. If not, - ** define BROKENPUTC1 and try again - if that works, good. Otherwise, - ** BROKENPUTC2 is guaranteed to work, although it's about twice as slow. - */ - /* #define PBMPLUS_BROKENPUTC1 */ - /* #define PBMPLUS_BROKENPUTC2 */ - - #ifdef PBMPLUS_BROKENPUTC1 - #undef putc - /* This is a fixed version of putc() that should work on most Unix systems. */ - #define putc(x,p) (--(p)->_cnt>=0? ((int)(unsigned char)(*(p)->_ptr++=(unsigned char)(x))) : _flsbuf((unsigned char)(x),p)) - #endif /*PBMPLUS_BROKENPUTC1*/ - #ifdef PBMPLUS_BROKENPUTC2 - #undef putc - /* For this one, putc() becomes a function, defined in pbm/libpbm1.c. */ - #endif /*PBMPLUS_BROKENPUTC2*/ /* CONFIGURE: PGM can store gray values as either bytes or shorts. For most ** applications, bytes will be big enough, and the memory savings can be --- 39,44 ---- diff -cr pbmplus30oct91/version.h version.h *** pbmplus30oct91/version.h Wed Oct 30 20:11:25 1991 --- version.h Tue Dec 10 16:53:28 1991 *************** *** 1,4 **** /* version.h - define the current version of PBM, PGM, PPM, and PNM */ ! #define PBMPLUS_VERSION "30oct91" --- 1,4 ---- /* version.h - define the current version of PBM, PGM, PPM, and PNM */ ! #define PBMPLUS_VERSION "10dec91" diff -cr pbmplus30oct91/pbm/Makefile pbm/Makefile *** pbmplus30oct91/pbm/Makefile Thu Oct 24 13:34:36 1991 --- pbm/Makefile Tue Dec 10 16:51:57 1991 *************** *** 42,49 **** pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \ pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \ pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \ ! pbmupc pi3topbm xbmtopbm \ ! ybmtopbm OBJECTS = atktopbm.o brushtopbm.o cmuwmtopbm.o g3topbm.o \ icontopbm.o gemtopbm.o macptopbm.o mgrtopbm.o \ --- 42,48 ---- pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \ pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \ pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \ ! pbmupc pi3topbm xbmtopbm ybmtopbm OBJECTS = atktopbm.o brushtopbm.o cmuwmtopbm.o g3topbm.o \ icontopbm.o gemtopbm.o macptopbm.o mgrtopbm.o \ *************** *** 53,60 **** pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \ pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \ pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \ ! pbmupc.o pi3topbm.o xbmtopbm.o \ ! ybmtopbm.o MANUALS1 = $(BINARIES) MANUALS3 = libpbm --- 52,58 ---- pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \ pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \ pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \ ! pbmupc.o pi3topbm.o xbmtopbm.o ybmtopbm.o MANUALS1 = $(BINARIES) MANUALS3 = libpbm diff -cr pbmplus30oct91/pbm/atktopbm.c pbm/atktopbm.c *** pbmplus30oct91/pbm/atktopbm.c Thu Sep 26 18:55:48 1991 --- pbm/atktopbm.c Tue Dec 10 16:53:16 1991 *************** *** 21,27 **** int argc; char *argv[]; { ! FILE *ifd; register bit *bitrow, *bP; int rows, cols, row, col, charcount; unsigned char *data, mask; --- 21,27 ---- int argc; char *argv[]; { ! FILE *ifp; register bit *bitrow, *bP; int rows, cols, row, col, charcount; unsigned char *data, mask; *************** *** 32,44 **** pm_usage( "[raster obj]" ); if ( argc == 2 ) ! ifd = pm_openr( argv[1] ); else ! ifd = stdin; ! ReadATKRaster( ifd, &cols, &rows, &data ); ! pm_close( ifd ); pbm_writepbminit( stdout, cols, rows, 0 ); bitrow = pbm_allocrow( cols ); --- 32,44 ---- pm_usage( "[raster obj]" ); if ( argc == 2 ) ! ifp = pm_openr( argv[1] ); else ! ifp = stdin; ! ReadATKRaster( ifp, &cols, &rows, &data ); ! pm_close( ifp ); pbm_writepbminit( stdout, cols, rows, 0 ); bitrow = pbm_allocrow( cols ); *************** *** 63,68 **** --- 63,69 ---- pbm_writepbmrow( stdout, bitrow, cols, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/brushtopbm.c pbm/brushtopbm.c *** pbmplus30oct91/pbm/brushtopbm.c Fri Jun 28 14:28:18 1991 --- pbm/brushtopbm.c Tue Dec 10 16:52:20 1991 *************** *** 56,61 **** --- 56,62 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/cmuwmtopbm.c pbm/cmuwmtopbm.c *** pbmplus30oct91/pbm/cmuwmtopbm.c Fri Jun 28 14:42:04 1991 --- pbm/cmuwmtopbm.c Tue Dec 10 16:52:36 1991 *************** *** 58,63 **** --- 58,64 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/g3topbm.c pbm/g3topbm.c *** pbmplus30oct91/pbm/g3topbm.c Fri Jun 28 14:51:31 1991 --- pbm/g3topbm.c Tue Dec 10 16:52:11 1991 *************** *** 123,128 **** --- 123,129 ---- pbm_writepbminit( stdout, cols, rows, 0 ); for ( row = 0; row < rows; ++row ) pbm_writepbmrow( stdout, bits[row], cols, 0 ); + pm_close( stdout ); exit(0); } diff -cr pbmplus30oct91/pbm/gemtopbm.c pbm/gemtopbm.c *** pbmplus30oct91/pbm/gemtopbm.c Fri Jun 28 14:42:07 1991 --- pbm/gemtopbm.c Tue Dec 10 16:52:30 1991 *************** *** 209,214 **** --- 209,215 ---- } while (linerep--); } pm_close( f ); + pm_close( stdout ); exit(0); } diff -cr pbmplus30oct91/pbm/icontopbm.c pbm/icontopbm.c *** pbmplus30oct91/pbm/icontopbm.c Fri Jun 28 14:28:25 1991 --- pbm/icontopbm.c Tue Dec 10 16:51:58 1991 *************** *** 62,67 **** --- 62,68 ---- pbm_writepbmrow( stdout, bitrow, cols, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/libpbm1.c pbm/libpbm1.c *** pbmplus30oct91/pbm/libpbm1.c Wed Jul 3 13:08:09 1991 --- pbm/libpbm1.c Tue Dec 10 16:52:45 1991 *************** *** 376,382 **** { if ( *format != '%' ) { /* Not special, just write out the char. */ ! putc( *format, stream ); ++n; ++format; } --- 376,382 ---- { if ( *format != '%' ) { /* Not special, just write out the char. */ ! (void) putc( *format, stream ); ++n; ++format; } *************** *** 467,473 **** break; case '%': ! putc( '%', stream ); ++n; break; --- 467,473 ---- break; case '%': ! (void) putc( '%', stream ); ++n; break; *************** *** 533,555 **** pm_close( f ) FILE* f; { if ( f != stdin ) if ( fclose( f ) != 0 ) pm_perror( "fclose" ); } - /* Broken putc() fix. */ - - #ifdef PBMPLUS_BROKENPUTC2 - int - putc( c, stream ) - char c; - FILE* stream; - { - return fwrite( &c, 1, 1, stream ) == 1 ? c : EOF; - } - #endif /*PBMPLUS_BROKENPUTC2*/ - /* Endian I/O. */ --- 533,546 ---- pm_close( f ) FILE* f; { + fflush( f ); + if ( ferror( f ) ) + pm_message( "a file read or write error occurred at some point" ); if ( f != stdin ) if ( fclose( f ) != 0 ) pm_perror( "fclose" ); } /* Endian I/O. */ *************** *** 579,588 **** short s; #endif /*__STDC__*/ { ! if ( putc( ( s >> 8 ) & 0xff, out ) == EOF ) ! return -1; ! if ( putc( s & 0xff, out ) == EOF ) ! return -1; return 0; } --- 570,577 ---- short s; #endif /*__STDC__*/ { ! (void) putc( ( s >> 8 ) & 0xff, out ); ! (void) putc( s & 0xff, out ); return 0; } *************** *** 613,626 **** FILE* out; long l; { ! if ( putc( ( l >> 24 ) & 0xff, out ) == EOF ) ! return -1; ! if ( putc( ( l >> 16 ) & 0xff, out ) == EOF ) ! return -1; ! if ( putc( ( l >> 8 ) & 0xff, out ) == EOF ) ! return -1; ! if ( putc( l & 0xff, out ) == EOF ) ! return -1; return 0; } --- 602,611 ---- FILE* out; long l; { ! (void) putc( ( l >> 24 ) & 0xff, out ); ! (void) putc( ( l >> 16 ) & 0xff, out ); ! (void) putc( ( l >> 8 ) & 0xff, out ); ! (void) putc( l & 0xff, out ); return 0; } *************** *** 650,659 **** short s; #endif /*__STDC__*/ { ! if ( putc( s & 0xff, out ) == EOF ) ! return -1; ! if ( putc( ( s >> 8 ) & 0xff, out ) == EOF ) ! return -1; return 0; } --- 635,642 ---- short s; #endif /*__STDC__*/ { ! (void) putc( s & 0xff, out ); ! (void) putc( ( s >> 8 ) & 0xff, out ); return 0; } *************** *** 684,696 **** FILE* out; long l; { ! if ( putc( l & 0xff, out ) == EOF ) ! return -1; ! if ( putc( ( l >> 8 ) & 0xff, out ) == EOF ) ! return -1; ! if ( putc( ( l >> 16 ) & 0xff, out ) == EOF ) ! return -1; ! if ( putc( ( l >> 24 ) & 0xff, out ) == EOF ) ! return -1; return 0; } --- 667,675 ---- FILE* out; long l; { ! (void) putc( l & 0xff, out ); ! (void) putc( ( l >> 8 ) & 0xff, out ); ! (void) putc( ( l >> 16 ) & 0xff, out ); ! (void) putc( ( l >> 24 ) & 0xff, out ); return 0; } diff -cr pbmplus30oct91/pbm/libpbm3.c pbm/libpbm3.c *** pbmplus30oct91/pbm/libpbm3.c Fri Jun 28 14:28:29 1991 --- pbm/libpbm3.c Tue Dec 10 16:52:47 1991 *************** *** 49,63 **** --bitshift; if ( bitshift == -1 ) { ! if ( putc( item, file ) == EOF ) ! pm_error( "write error" ); bitshift = 7; item = 0; } } if ( bitshift != 7 ) ! if ( putc( item, file ) == EOF ) ! pm_error( "write error" ); } #endif /*PBMPLUS_RAWBITS*/ --- 49,61 ---- --bitshift; if ( bitshift == -1 ) { ! (void) putc( item, file ); bitshift = 7; item = 0; } } if ( bitshift != 7 ) ! (void) putc( item, file ); } #endif /*PBMPLUS_RAWBITS*/ *************** *** 75,90 **** { if ( charcount >= 70 ) { ! if ( putc( '\n', file ) == EOF ) ! pm_error( "write error" ); charcount = 0; } ! if ( putc( *bP ? '1' : '0', file ) == EOF ) ! pm_error( "write error" ); ++charcount; } ! if ( putc( '\n', file ) == EOF ) ! pm_error( "write error" ); } void --- 73,85 ---- { if ( charcount >= 70 ) { ! (void) putc( '\n', file ); charcount = 0; } ! (void) putc( *bP ? '1' : '0', file ); ++charcount; } ! (void) putc( '\n', file ); } void diff -cr pbmplus30oct91/pbm/libpbm4.c pbm/libpbm4.c *** pbmplus30oct91/pbm/libpbm4.c Fri Jun 28 14:28:31 1991 --- pbm/libpbm4.c Tue Dec 10 16:52:47 1991 *************** *** 34,40 **** pm_error( "EOF / read error" ); ch = (char) ich; } ! while ( ch != '\n' ); } return ch; --- 34,40 ---- pm_error( "EOF / read error" ); ch = (char) ich; } ! while ( ch != '\n' && ch != '\r' ); } return ch; *************** *** 63,69 **** { ch = pbm_getc( file ); } ! while ( ch == ' ' || ch == '\t' || ch == '\n' ); if ( ch < '0' || ch > '9' ) pm_error( "junk in file where an integer should be" ); --- 63,69 ---- { ch = pbm_getc( file ); } ! while ( ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' ); if ( ch < '0' || ch > '9' ) pm_error( "junk in file where an integer should be" ); diff -cr pbmplus30oct91/pbm/macptopbm.c pbm/macptopbm.c *** pbmplus30oct91/pbm/macptopbm.c Fri Jun 28 14:28:33 1991 --- pbm/macptopbm.c Tue Dec 10 16:52:00 1991 *************** *** 74,79 **** --- 74,80 ---- pbm_writepbmrow( stdout, bitrow, cols, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/mgrtopbm.c pbm/mgrtopbm.c *** pbmplus30oct91/pbm/mgrtopbm.c Fri Jun 28 14:42:09 1991 --- pbm/mgrtopbm.c Tue Dec 10 16:52:22 1991 *************** *** 55,60 **** --- 55,61 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/pbmlife.c pbm/pbmlife.c *** pbmplus30oct91/pbm/pbmlife.c Fri Jun 28 14:28:35 1991 --- pbm/pbmlife.c Tue Dec 10 16:52:34 1991 *************** *** 107,112 **** --- 107,113 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/pbmmake.c pbm/pbmmake.c *** pbmplus30oct91/pbm/pbmmake.c Fri Jun 28 14:28:36 1991 --- pbm/pbmmake.c Tue Dec 10 16:52:13 1991 *************** *** 79,83 **** --- 79,84 ---- pbm_writepbmrow( stdout, bitrow, cols, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/pbmmask.c pbm/pbmmask.c *** pbmplus30oct91/pbm/pbmmask.c Fri Jun 28 14:28:37 1991 --- pbm/pbmmask.c Tue Dec 10 16:53:07 1991 *************** *** 133,138 **** --- 133,139 ---- pbm_writepbm( stdout, emask, cols, rows, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/pbmmerge.c pbm/pbmmerge.c *** pbmplus30oct91/pbm/pbmmerge.c Thu Sep 26 18:38:29 1991 --- pbm/pbmmerge.c Tue Dec 10 16:52:54 1991 *************** *** 32,38 **** goto again; } ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); } TRY( "atktopbm", atktopbm_main ); TRY( "brushtopbm", brushtopbm_main ); --- 32,38 ---- goto again; } ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); } TRY( "atktopbm", atktopbm_main ); TRY( "brushtopbm", brushtopbm_main ); diff -cr pbmplus30oct91/pbm/pbmreduce.c pbm/pbmreduce.c *** pbmplus30oct91/pbm/pbmreduce.c Sun Jul 7 17:29:03 1991 --- pbm/pbmreduce.c Tue Dec 10 16:52:28 1991 *************** *** 193,198 **** --- 193,199 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/pbmtext.c pbm/pbmtext.c *** pbmplus30oct91/pbm/pbmtext.c Fri Jun 28 14:28:43 1991 --- pbm/pbmtext.c Tue Dec 10 16:52:39 1991 *************** *** 152,157 **** --- 152,158 ---- /* All done. */ pbm_writepbm( stdout, bits, cols, rows, 0 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/pbmtocmuwm.c pbm/pbmtocmuwm.c *** pbmplus30oct91/pbm/pbmtocmuwm.c Fri Jun 28 14:28:47 1991 --- pbm/pbmtocmuwm.c Tue Dec 10 16:52:37 1991 *************** *** 109,116 **** static void putitem( ) { ! if ( putc( item, stdout ) == EOF ) ! pm_error( "write error" ); item = 0; bitsperitem = 0; bitshift = 7; --- 109,115 ---- static void putitem( ) { ! (void) putc( item, stdout ); item = 0; bitsperitem = 0; bitshift = 7; diff -cr pbmplus30oct91/pbm/pbmtogem.c pbm/pbmtogem.c *** pbmplus30oct91/pbm/pbmtogem.c Fri Jun 28 14:28:51 1991 --- pbm/pbmtogem.c Tue Dec 10 16:53:00 1991 *************** *** 155,162 **** static void putrow( ) { ! putc(0x80, stdout); /* a Bit string */ ! putc(outcol*2, stdout); /* count */ fwrite( outrow, outcol*2, 1, stdout ); outcol = 0; } --- 155,162 ---- static void putrow( ) { ! (void) putc(0x80, stdout); /* a Bit string */ ! (void) putc(outcol*2, stdout); /* count */ fwrite( outrow, outcol*2, 1, stdout ); outcol = 0; } diff -cr pbmplus30oct91/pbm/pbmtomacp.c pbm/pbmtomacp.c *** pbmplus30oct91/pbm/pbmtomacp.c Fri Jun 28 14:28:57 1991 --- pbm/pbmtomacp.c Tue Dec 10 16:52:16 1991 *************** *** 280,286 **** b = pb; while( npb-- ) ! putc( *b++, fdout ); } /* sendbytes */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - */ --- 280,286 ---- b = pb; while( npb-- ) ! (void) putc( *b++, fdout ); } /* sendbytes */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - */ *************** *** 293,297 **** /* header contains nothing ... */ ch = '\0'; for(i = 0; i < HEADER_LENGTH; i++ ) ! putc( ch, fdout ); } /* header */ --- 293,297 ---- /* header contains nothing ... */ ch = '\0'; for(i = 0; i < HEADER_LENGTH; i++ ) ! (void) putc( ch, fdout ); } /* header */ diff -cr pbmplus30oct91/pbm/pbmupc.c pbm/pbmupc.c *** pbmplus30oct91/pbm/pbmupc.c Fri Jun 28 14:39:31 1991 --- pbm/pbmupc.c Tue Dec 10 16:52:43 1991 *************** *** 141,146 **** --- 141,147 ---- putdigit( sum, bits, digrow, col + LINE1_WIDTH ); pbm_writepbm( stdout, bits, cols, rows, 0 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/pi3topbm.c pbm/pi3topbm.c *** pbmplus30oct91/pbm/pi3topbm.c Fri Jun 28 14:29:09 1991 --- pbm/pi3topbm.c Tue Dec 10 16:53:02 1991 *************** *** 90,94 **** --- 90,95 ---- pbm_writepbmrow( stdout, bitrow, cols, 0 ); } pm_close( f ); + pm_close( stdout ); exit(0); } diff -cr pbmplus30oct91/pbm/xbmtopbm.c pbm/xbmtopbm.c *** pbmplus30oct91/pbm/xbmtopbm.c Fri Jun 28 14:29:10 1991 --- pbm/xbmtopbm.c Tue Dec 10 16:52:02 1991 *************** *** 63,68 **** --- 63,69 ---- pbm_writepbmrow( stdout, bitrow, cols, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pbm/ybmtopbm.c pbm/ybmtopbm.c *** pbmplus30oct91/pbm/ybmtopbm.c Fri Jun 28 14:42:10 1991 --- pbm/ybmtopbm.c Tue Dec 10 16:52:57 1991 *************** *** 60,65 **** --- 60,66 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/Makefile pgm/Makefile *** pbmplus30oct91/pgm/Makefile Fri Sep 27 12:33:43 1991 --- pgm/Makefile Tue Dec 10 16:53:33 1991 *************** *** 41,53 **** pgmenhance pgmhist pgmnorm pgmoil pgmramp \ pgmtofits pgmtofs pgmtolispm pgmtopbm \ psidtopgm rawtopgm ! MATHBINARIES = pgmedge pgmtexture BINARIES = $(PORTBINARIES) $(MATHBINARIES) OBJECTS = fitstopgm.o fstopgm.o hipstopgm.o lispmtopgm.o pgmbentley.o \ pgmenhance.o pgmhist.o pgmnorm.o pgmoil.o pgmramp.o \ pgmtofits.o pgmtofs.o pgmtolispm.o pgmtopbm.o \ ! psidtopgm.o rawtopgm.o pgmedge.o pgmtexture.o MANUALS1 = $(BINARIES) MANUALS3 = libpgm --- 41,53 ---- pgmenhance pgmhist pgmnorm pgmoil pgmramp \ pgmtofits pgmtofs pgmtolispm pgmtopbm \ psidtopgm rawtopgm ! MATHBINARIES = pgmcrater pgmedge pgmtexture BINARIES = $(PORTBINARIES) $(MATHBINARIES) OBJECTS = fitstopgm.o fstopgm.o hipstopgm.o lispmtopgm.o pgmbentley.o \ pgmenhance.o pgmhist.o pgmnorm.o pgmoil.o pgmramp.o \ pgmtofits.o pgmtofs.o pgmtolispm.o pgmtopbm.o \ ! psidtopgm.o rawtopgm.o pgmcrater.o pgmedge.o pgmtexture.o MANUALS1 = $(BINARIES) MANUALS3 = libpgm *************** *** 126,131 **** --- 126,132 ---- hipstopgm hipstopgm.o: hipstopgm.c lispmtopgm lispmtopgm.o: lispmtopgm.c pgmbentley pgmbentley.o: pgmbentley.c + pgmcrater pgmcrater.o: pgmcrater.c pgmedge pgmedge.o: pgmedge.c pgmenhance pgmenhance.o: pgmenhance.c pgmhist pgmhist.o: pgmhist.c diff -cr pbmplus30oct91/pgm/fitstopgm.c pgm/fitstopgm.c *** pbmplus30oct91/pgm/fitstopgm.c Wed Sep 25 22:47:36 1991 --- pgm/fitstopgm.c Tue Dec 10 16:53:53 1991 *************** *** 186,191 **** --- 186,192 ---- } } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/fstopgm.c pgm/fstopgm.c *** pbmplus30oct91/pgm/fstopgm.c Sat Jul 6 10:24:32 1991 --- pgm/fstopgm.c Tue Dec 10 16:53:39 1991 *************** *** 105,110 **** --- 105,111 ---- /* And write out the graymap. */ pgm_writepgm( stdout, grays, cols, rows, (gray) maxval, 0 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/hipstopgm.c pgm/hipstopgm.c *** pbmplus30oct91/pgm/hipstopgm.c Fri Jun 28 15:10:53 1991 --- pgm/hipstopgm.c Tue Dec 10 16:53:41 1991 *************** *** 115,120 **** --- 115,121 ---- pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 ); } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/libpgm2.c pgm/libpgm2.c *** pbmplus30oct91/pgm/libpgm2.c Fri Jun 28 14:29:17 1991 --- pgm/libpgm2.c Tue Dec 10 16:53:37 1991 *************** *** 41,55 **** #endif /*PBMPLUS_RAWBITS*/ } ! static int putus( n, file ) unsigned short n; FILE* file; { if ( n >= 10 ) ! if ( putus( n / 10, file ) == EOF ) ! return EOF; ! return putc( n % 10 + '0', file ); } #ifdef PBMPLUS_RAWBITS --- 41,54 ---- #endif /*PBMPLUS_RAWBITS*/ } ! static void putus( n, file ) unsigned short n; FILE* file; { if ( n >= 10 ) ! putus( n / 10, file ); ! (void) putc( n % 10 + '0', file ); } #ifdef PBMPLUS_RAWBITS *************** *** 69,76 **** if ( *gP > maxval ) pm_error( "value out of bounds (%u > %u)", *gP, maxval ); #endif /*DEBUG*/ ! if ( putc( *gP, file ) == EOF ) ! pm_error( "write error" ); } } #endif /*PBMPLUS_RAWBITS*/ --- 68,74 ---- if ( *gP > maxval ) pm_error( "value out of bounds (%u > %u)", *gP, maxval ); #endif /*DEBUG*/ ! (void) putc( *gP, file ); } } #endif /*PBMPLUS_RAWBITS*/ *************** *** 90,103 **** { if ( charcount >= 65 ) { ! if ( putc( '\n', file ) == EOF ) ! pm_error( "write error" ); charcount = 0; } else if ( charcount > 0 ) { ! if ( putc( ' ', file ) == EOF ) ! pm_error( "write error" ); ++charcount; } #ifdef DEBUG --- 88,99 ---- { if ( charcount >= 65 ) { ! (void) putc( '\n', file ); charcount = 0; } else if ( charcount > 0 ) { ! (void) putc( ' ', file ); ++charcount; } #ifdef DEBUG *************** *** 104,116 **** if ( *gP > maxval ) pm_error( "value out of bounds (%u > %u)", *gP, maxval ); #endif /*DEBUG*/ ! if ( putus( (unsigned long) *gP, file ) == EOF ) ! pm_error( "write error" ); charcount += 3; } if ( charcount > 0 ) ! if ( putc( '\n', file ) == EOF ) ! pm_error( "write error" ); } #if __STDC__ --- 100,110 ---- if ( *gP > maxval ) pm_error( "value out of bounds (%u > %u)", *gP, maxval ); #endif /*DEBUG*/ ! putus( (unsigned long) *gP, file ); charcount += 3; } if ( charcount > 0 ) ! (void) putc( '\n', file ); } #if __STDC__ diff -cr pbmplus30oct91/pgm/lispmtopgm.c pgm/lispmtopgm.c *** pbmplus30oct91/pgm/lispmtopgm.c Fri Jun 28 15:12:29 1991 --- pgm/lispmtopgm.c Tue Dec 10 16:53:54 1991 *************** *** 63,68 **** --- 63,69 ---- pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 ); } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/pgm.5 pgm/pgm.5 *** pbmplus30oct91/pgm/pgm.5 Thu Sep 26 16:13:49 1991 --- pgm/pgm.5 Tue Dec 10 16:53:34 1991 *************** *** 1,4 **** ! .TH pgm 5 "27 September 1991" .SH NAME pgm - portable graymap file format .SH DESCRIPTION --- 1,4 ---- ! .TH pgm 5 "12 November 1991" .SH NAME pgm - portable graymap file format .SH DESCRIPTION *************** *** 76,82 **** .SH "SEE ALSO" fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psidtopgm(1), rawtopgm(1), ! pgmbentley(1), pgmedge(1), pgmenhance(1), pgmhist(1), pgmnorm(1), pgmoil(1), pgmramp(1), pgmtexture(1), pgmtofits(1), pgmtofs(1), pgmtolispm(1), pgmtopbm(1), pnm(5), pbm(5), ppm(5) --- 76,82 ---- .SH "SEE ALSO" fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psidtopgm(1), rawtopgm(1), ! pgmbentley(1), pgmcrater(1), pgmedge(1), pgmenhance(1), pgmhist(1), pgmnorm(1), pgmoil(1), pgmramp(1), pgmtexture(1), pgmtofits(1), pgmtofs(1), pgmtolispm(1), pgmtopbm(1), pnm(5), pbm(5), ppm(5) diff -cr pbmplus30oct91/pgm/pgmbentley.c pgm/pgmbentley.c *** pbmplus30oct91/pgm/pgmbentley.c Fri Jun 28 14:29:20 1991 --- pgm/pgmbentley.c Tue Dec 10 16:54:10 1991 *************** *** 56,61 **** --- 56,62 ---- } pgm_writepgm( stdout, gout, cols, rows, maxval, 0 ); + pm_close( stdout ); pgm_freearray( gout, rows ); exit( 0 ); diff -cr pbmplus30oct91/pgm/pgmedge.c pgm/pgmedge.c *** pbmplus30oct91/pgm/pgmedge.c Fri Jun 28 14:29:21 1991 --- pgm/pgmedge.c Tue Dec 10 16:54:06 1991 *************** *** 101,105 **** --- 101,107 ---- orow[col] = 0; pgm_writepgmrow( stdout, orow, cols, maxval, 0 ); + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/pgm/pgmenhance.c pgm/pgmenhance.c *** pbmplus30oct91/pgm/pgmenhance.c Fri Jun 28 14:29:23 1991 --- pgm/pgmenhance.c Tue Dec 10 16:53:43 1991 *************** *** 113,123 **** *ngP = thisrow[cols - 1]; pgm_writepgmrow( stdout, newrow, cols, maxval, 0 ); } /* Last row. */ pgm_writepgmrow( stdout, nextrow, cols, maxval, 0 ); ! pm_close( ifp ); exit( 0 ); } --- 113,124 ---- *ngP = thisrow[cols - 1]; pgm_writepgmrow( stdout, newrow, cols, maxval, 0 ); } + pm_close( ifp ); /* Last row. */ pgm_writepgmrow( stdout, nextrow, cols, maxval, 0 ); ! pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/pgmmerge.c pgm/pgmmerge.c *** pbmplus30oct91/pgm/pgmmerge.c Thu Sep 26 16:52:44 1991 --- pgm/pgmmerge.c Tue Dec 10 16:54:05 1991 *************** *** 32,38 **** goto again; } ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); } TRY("fitstopgm", fitstopgm_main); TRY("fstopgm", fstopgm_main); --- 32,38 ---- goto again; } ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); } TRY("fitstopgm", fitstopgm_main); TRY("fstopgm", fstopgm_main); *************** *** 39,44 **** --- 39,45 ---- TRY("hipstopgm", hipstopgm_main); TRY("lispmtopgm", lispmtopgm_main); TRY("pgmbentley", pgmbentley_main); + TRY("pgmcrater", pgmcrater_main); TRY("pgmedge", pgmedge_main); TRY("pgmenhance", pgmenhance_main); TRY("pgmhist", pgmhist_main); diff -cr pbmplus30oct91/pgm/pgmnorm.c pgm/pgmnorm.c *** pbmplus30oct91/pgm/pgmnorm.c Fri Jun 28 15:14:52 1991 --- pgm/pgmnorm.c Tue Dec 10 16:54:00 1991 *************** *** 177,181 **** --- 177,182 ---- } } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/pgmoil.c pgm/pgmoil.c *** pbmplus30oct91/pgm/pgmoil.c Wed Oct 30 13:04:36 1991 --- pgm/pgmoil.c Tue Dec 10 16:54:11 1991 *************** *** 89,93 **** --- 89,94 ---- pgm_writepgmrow( stdout, grayrow, cols, maxval, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/pgmramp.c pgm/pgmramp.c *** pbmplus30oct91/pgm/pgmramp.c Sat Oct 5 23:08:10 1991 --- pgm/pgmramp.c Tue Dec 10 16:54:04 1991 *************** *** 97,101 **** --- 97,102 ---- pgm_writepgmrow( stdout, grayrow, cols, PGM_MAXMAXVAL, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/pgmtopbm.c pgm/pgmtopbm.c *** pbmplus30oct91/pgm/pgmtopbm.c Sun Jul 7 17:29:11 1991 --- pgm/pgmtopbm.c Tue Dec 10 16:53:48 1991 *************** *** 146,152 **** default: pm_error( "can't happen" ); - exit( 1 ); } for ( row = 0; row < rows; ++row ) --- 146,151 ---- *************** *** 255,261 **** default: pm_error( "can't happen" ); - exit( 1 ); } pbm_writepbmrow( stdout, bitrow, cols, 0 ); --- 254,259 ---- *************** *** 262,267 **** --- 260,266 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/psidtopgm.c pgm/psidtopgm.c *** pbmplus30oct91/pgm/psidtopgm.c Fri Jun 28 15:17:11 1991 --- pgm/psidtopgm.c Tue Dec 10 16:53:51 1991 *************** *** 105,110 **** --- 105,111 ---- pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 ); } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pgm/rawtopgm.c pgm/rawtopgm.c *** pbmplus30oct91/pgm/rawtopgm.c Fri Jun 28 14:29:38 1991 --- pgm/rawtopgm.c Tue Dec 10 16:53:46 1991 *************** *** 100,105 **** --- 100,106 ---- pgm_writepgmrow( stdout, grayrow, cols, (gray) 255, 0 ); } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/Makefile ppm/Makefile *** pbmplus30oct91/ppm/Makefile Thu Oct 24 13:34:40 1991 --- ppm/Makefile Tue Dec 10 16:55:21 1991 *************** *** 47,73 **** PORTBINARIES = giftoppm gouldtoppm ilbmtoppm imgtoppm mtvtoppm \ pcxtoppm pgmtoppm pi1toppm picttoppm \ ! pjtoppm ppmdither ppmhist ppmmake ppmquant \ ! ppmrelief ppmtogif ppmtoicr ppmtoilbm \ ! ppmtopcx ppmtopgm ppmtopi1 ppmtopict \ ppmtopj ppmtopuzz ppmtorgb3 ppmtosixel \ ppmtotga ppmtouil ppmtoxpm ppmtoyuv qrttoppm \ ! rawtoppm rgb3toppm spctoppm sputoppm \ tgatoppm ximtoppm xpmtoppm yuvtoppm ! MATHBINARIES = ppmpat BINARIES = $(PORTBINARIES) $(MATHBINARIES) SCRIPTS = ppmquantall OBJECTS = giftoppm.o gouldtoppm.o ilbmtoppm.o imgtoppm.o mtvtoppm.o \ pcxtoppm.o pgmtoppm.o pi1toppm.o picttoppm.o \ ! pjtoppm.o ppmdither.o ppmhist.o ppmmake.o ppmquant.o \ ! ppmrelief.o ppmtogif.o ppmtoicr.o ppmtoilbm.o \ ! ppmtopcx.o ppmtopgm.o ppmtopi1.o ppmtopict.o \ ppmtopj.o ppmtopuzz.o ppmtorgb3.o ppmtosixel.o \ ppmtotga.o ppmtouil.o ppmtoxpm.o ppmtoyuv.o qrttoppm.o \ ! rawtoppm.o rgb3toppm.o spctoppm.o sputoppm.o \ tgatoppm.o ximtoppm.o xpmtoppm.o yuvtoppm.o \ ! ppmpat.o MANUALS1 = $(BINARIES) $(SCRIPTS) MANUALS3 = libppm --- 47,73 ---- PORTBINARIES = giftoppm gouldtoppm ilbmtoppm imgtoppm mtvtoppm \ pcxtoppm pgmtoppm pi1toppm picttoppm \ ! pjtoppm ppmdither ppmhist ppmmake \ ! ppmquant ppmrelief ppmtoacad ppmtogif ppmtoicr \ ! ppmtoilbm ppmtopcx ppmtopgm ppmtopi1 ppmtopict \ ppmtopj ppmtopuzz ppmtorgb3 ppmtosixel \ ppmtotga ppmtouil ppmtoxpm ppmtoyuv qrttoppm \ ! rawtoppm rgb3toppm sldtoppm spctoppm sputoppm \ tgatoppm ximtoppm xpmtoppm yuvtoppm ! MATHBINARIES = ppmforge ppmpat BINARIES = $(PORTBINARIES) $(MATHBINARIES) SCRIPTS = ppmquantall OBJECTS = giftoppm.o gouldtoppm.o ilbmtoppm.o imgtoppm.o mtvtoppm.o \ pcxtoppm.o pgmtoppm.o pi1toppm.o picttoppm.o \ ! pjtoppm.o ppmdither.o ppmhist.o ppmmake.o \ ! ppmquant.o ppmrelief.o ppmtoacad.o ppmtogif.o ppmtoicr.o \ ! ppmtoilbm.o ppmtopcx.o ppmtopgm.o ppmtopi1.o ppmtopict.o \ ppmtopj.o ppmtopuzz.o ppmtorgb3.o ppmtosixel.o \ ppmtotga.o ppmtouil.o ppmtoxpm.o ppmtoyuv.o qrttoppm.o \ ! rawtoppm.o rgb3toppm.o sldtoppm.o spctoppm.o sputoppm.o \ tgatoppm.o ximtoppm.o xpmtoppm.o yuvtoppm.o \ ! ppmforge.o ppmpat.o MANUALS1 = $(BINARIES) $(SCRIPTS) MANUALS3 = libppm *************** *** 167,177 **** --- 167,179 ---- picttoppm picttoppm.o: picttoppm.c pjtoppm pjtoppm.o: pjtoppm.c ppmdither ppmdither.o: ppmdither.c + ppmforge ppmforge.o: ppmforge.c ppmhist ppmhist.o: ppmhist.c ppmcmap.h ppmmake ppmmake.o: ppmmake.c ppmpat ppmpat.o: ppmpat.c ppmdraw.h ppmquant ppmquant.o: ppmquant.c $(PGMDIR)/dithers.h ppmcmap.h ppmrelief ppmrelief.o: ppmrelief.c + ppmtoacad ppmtoacad.o: ppmtoacad.c ppmcmap.h autocad.h ppmtogif ppmtogif.o: ppmtogif.c ppmcmap.h ppmtoicr ppmtoicr.o: ppmtoicr.c ppmcmap.h ppmtoilbm ppmtoilbm.o: ppmtoilbm.c ilbm.h ppmcmap.h *************** *** 190,195 **** --- 192,198 ---- qrttoppm qrttoppm.o: qrttoppm.c rawtoppm rawtoppm.o: rawtoppm.c rgb3toppm rgb3toppm.o: rgb3toppm.c + sldtoppm sldtoppm.o: sldtoppm.c ppmdraw.h autocad.h spctoppm spctoppm.o: spctoppm.c sputoppm sputoppm.o: sputoppm.c tgatoppm tgatoppm.o: tgatoppm.c tga.h diff -cr pbmplus30oct91/ppm/giftoppm.c ppm/giftoppm.c *** pbmplus30oct91/ppm/giftoppm.c Sat Oct 5 22:36:46 1991 --- ppm/giftoppm.c Tue Dec 10 16:55:36 1991 *************** *** 104,109 **** --- 104,110 ---- ReadGIF(in, imageNumber); pm_close(in); + pm_close(stdout); exit(0); } *************** *** 286,293 **** break; } ! pm_message("got a '%s' extension - please report this to koblas@mips.com", ! str ); while (GetDataBlock(fd, (unsigned char*) buf) != 0) ; --- 287,293 ---- break; } ! pm_message("got a '%s' extension", str ); while (GetDataBlock(fd, (unsigned char*) buf) != 0) ; diff -cr pbmplus30oct91/ppm/gouldtoppm.c ppm/gouldtoppm.c *** pbmplus30oct91/ppm/gouldtoppm.c Fri Jun 28 14:35:23 1991 --- ppm/gouldtoppm.c Tue Dec 10 16:56:34 1991 *************** *** 84,89 **** --- 84,90 ---- } pm_close(ifp); + pm_close(stdout); exit(0); } diff -cr pbmplus30oct91/ppm/ilbmtoppm.c ppm/ilbmtoppm.c *** pbmplus30oct91/ppm/ilbmtoppm.c Fri Sep 27 01:25:46 1991 --- ppm/ilbmtoppm.c Tue Dec 10 16:55:39 1991 *************** *** 364,369 **** --- 364,371 ---- ppm_writeppmrow( stdout, pixelrow, cols, (pixval) maxval, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/ppm/imgtoppm.c ppm/imgtoppm.c *** pbmplus30oct91/ppm/imgtoppm.c Fri Jun 28 14:30:24 1991 --- ppm/imgtoppm.c Tue Dec 10 16:56:00 1991 *************** *** 122,127 **** --- 122,128 ---- ppm_writeppmrow( stdout, pixelrow, cols, maxval, 0 ); } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } } diff -cr pbmplus30oct91/ppm/libppm2.c ppm/libppm2.c *** pbmplus30oct91/ppm/libppm2.c Fri Jun 28 14:30:27 1991 --- ppm/libppm2.c Tue Dec 10 16:55:23 1991 *************** *** 41,55 **** #endif /*PBMPLUS_RAWBITS*/ } ! static int putus( n, file ) unsigned short n; FILE* file; { if ( n >= 10 ) ! if ( putus( n / 10, file ) == EOF ) ! return EOF; ! return putc( n % 10 + '0', file ); } #ifdef PBMPLUS_RAWBITS --- 41,54 ---- #endif /*PBMPLUS_RAWBITS*/ } ! static void putus( n, file ) unsigned short n; FILE* file; { if ( n >= 10 ) ! putus( n / 10, file ); ! (void) putc( n % 10 + '0', file ); } #ifdef PBMPLUS_RAWBITS *************** *** 71,92 **** if ( val > maxval ) pm_error( "r value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! if ( putc( val, file ) == EOF ) ! pm_error( "write error" ); val = PPM_GETG( *pP ); #ifdef DEBUG if ( val > maxval ) pm_error( "g value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! if ( putc( val, file ) == EOF ) ! pm_error( "write error" ); val = PPM_GETB( *pP ); #ifdef DEBUG if ( val > maxval ) pm_error( "b value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! if ( putc( val, file ) == EOF ) ! pm_error( "write error" ); } } #endif /*PBMPLUS_RAWBITS*/ --- 70,88 ---- if ( val > maxval ) pm_error( "r value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! (void) putc( val, file ); val = PPM_GETG( *pP ); #ifdef DEBUG if ( val > maxval ) pm_error( "g value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! (void) putc( val, file ); val = PPM_GETB( *pP ); #ifdef DEBUG if ( val > maxval ) pm_error( "b value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! (void) putc( val, file ); } } #endif /*PBMPLUS_RAWBITS*/ *************** *** 107,122 **** { if ( charcount >= 65 ) { ! if ( putc( '\n', file ) == EOF ) ! pm_error( "write error" ); charcount = 0; } else if ( charcount > 0 ) { ! if ( putc( ' ', file ) == EOF ) ! pm_error( "write error" ); ! if ( putc( ' ', file ) == EOF ) ! pm_error( "write error" ); charcount += 2; } val = PPM_GETR( *pP ); --- 103,115 ---- { if ( charcount >= 65 ) { ! (void) putc( '\n', file ); charcount = 0; } else if ( charcount > 0 ) { ! (void) putc( ' ', file ); ! (void) putc( ' ', file ); charcount += 2; } val = PPM_GETR( *pP ); *************** *** 124,154 **** if ( val > maxval ) pm_error( "r value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! if ( putus( val, file ) == EOF ) ! pm_error( "write error" ); ! if ( putc( ' ', file ) == EOF ) ! pm_error( "write error" ); val = PPM_GETG( *pP ); #ifdef DEBUG if ( val > maxval ) pm_error( "g value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! if ( putus( val, file ) == EOF ) ! pm_error( "write error" ); ! if ( putc( ' ', file ) == EOF ) ! pm_error( "write error" ); val = PPM_GETB( *pP ); #ifdef DEBUG if ( val > maxval ) pm_error( "b value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! if ( putus( val, file ) == EOF ) ! pm_error( "write error" ); charcount += 11; } if ( charcount > 0 ) ! if ( putc( '\n', file ) == EOF ) ! pm_error( "write error" ); } #if __STDC__ --- 117,141 ---- if ( val > maxval ) pm_error( "r value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! putus( val, file ); ! (void) putc( ' ', file ); val = PPM_GETG( *pP ); #ifdef DEBUG if ( val > maxval ) pm_error( "g value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! putus( val, file ); ! (void) putc( ' ', file ); val = PPM_GETB( *pP ); #ifdef DEBUG if ( val > maxval ) pm_error( "b value out of bounds (%u > %u)", val, maxval ); #endif /*DEBUG*/ ! putus( val, file ); charcount += 11; } if ( charcount > 0 ) ! (void) putc( '\n', file ); } #if __STDC__ diff -cr pbmplus30oct91/ppm/mtvtoppm.c ppm/mtvtoppm.c *** pbmplus30oct91/ppm/mtvtoppm.c Fri Jun 28 14:30:33 1991 --- ppm/mtvtoppm.c Tue Dec 10 16:55:34 1991 *************** *** 61,66 **** --- 61,67 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/pcxtoppm.c ppm/pcxtoppm.c *** pbmplus30oct91/ppm/pcxtoppm.c Wed Sep 25 19:57:52 1991 --- ppm/pcxtoppm.c Tue Dec 10 16:56:24 1991 *************** *** 187,192 **** --- 187,194 ---- ppm_writeppm(stdout, pixels, Width, Height, (pixval) 255, 0 ); + pm_close(stdout); + exit(0); } diff -cr pbmplus30oct91/ppm/pgmtoppm.c ppm/pgmtoppm.c *** pbmplus30oct91/ppm/pgmtoppm.c Fri Jun 28 14:30:38 1991 --- ppm/pgmtoppm.c Tue Dec 10 16:56:32 1991 *************** *** 143,148 **** --- 143,149 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/pi1toppm.c ppm/pi1toppm.c *** pbmplus30oct91/ppm/pi1toppm.c Fri Sep 27 17:01:29 1991 --- ppm/pi1toppm.c Tue Dec 10 16:56:15 1991 *************** *** 84,88 **** --- 84,90 ---- ppm_writeppmrow( stdout, pixelrow, COLS, (pixval) MAXVAL, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/ppm/picttoppm.c ppm/picttoppm.c *** pbmplus30oct91/ppm/picttoppm.c Thu Sep 26 20:28:02 1991 --- ppm/picttoppm.c Tue Dec 10 16:56:09 1991 *************** *** 525,530 **** --- 525,531 ---- ppm_writeppmrow(stdout, pixelrow, width, (pixval) 255, 0 ); } + pm_close(stdout); } /* diff -cr pbmplus30oct91/ppm/pjtoppm.c ppm/pjtoppm.c *** pbmplus30oct91/ppm/pjtoppm.c Thu Sep 26 16:33:15 1991 --- ppm/pjtoppm.c Tue Dec 10 16:56:43 1991 *************** *** 245,249 **** --- 245,250 ---- } ppm_writeppmrow(stdout, pixrow, cols, (pixval) 255, 0); } + pm_close(stdout); exit(0); } diff -cr pbmplus30oct91/ppm/ppm.5 ppm/ppm.5 *** pbmplus30oct91/ppm/ppm.5 Fri Sep 27 01:41:17 1991 --- ppm/ppm.5 Tue Dec 10 16:55:29 1991 *************** *** 75,87 **** .SH "SEE ALSO" giftoppm(1), gouldtoppm(1), ilbmtoppm(1), imgtoppm(1), mtvtoppm(1), pcxtoppm(1), pgmtoppm(1), pi1toppm(1), picttoppm(1), pjtoppm(1), qrttoppm(1), ! rawtoppm(1), rgb3toppm(1), spctoppm(1), sputoppm(1), tgatoppm(1), ximtoppm(1), xpmtoppm(1), yuvtoppm(1), ! ppmtogif(1), ppmtoicr(1), ppmtoilbm(1), ppmtopcx(1), ppmtopgm(1), ppmtopi1(1), ppmtopict(1), ppmtopj(1), ppmtopuzz(1), ppmtorgb3(1), ppmtosixel(1), ppmtotga(1), ppmtouil(1), ppmtoxpm(1), ppmtoyuv(1), ! ppmdither(1), ppmhist(1), ppmmake(1), ppmpat(1), ppmquant(1), ppmquantall(1), ! ppmrelief(1), pnm(5), pgm(5), pbm(5) .SH AUTHOR Copyright (C) 1989, 1991 by Jef Poskanzer. --- 75,87 ---- .SH "SEE ALSO" giftoppm(1), gouldtoppm(1), ilbmtoppm(1), imgtoppm(1), mtvtoppm(1), pcxtoppm(1), pgmtoppm(1), pi1toppm(1), picttoppm(1), pjtoppm(1), qrttoppm(1), ! rawtoppm(1), rgb3toppm(1), sldtoppm(1), spctoppm(1), sputoppm(1), tgatoppm(1), ximtoppm(1), xpmtoppm(1), yuvtoppm(1), ! ppmtoacad(1), ppmtogif(1), ppmtoicr(1), ppmtoilbm(1), ppmtopcx(1), ppmtopgm(1), ppmtopi1(1), ppmtopict(1), ppmtopj(1), ppmtopuzz(1), ppmtorgb3(1), ppmtosixel(1), ppmtotga(1), ppmtouil(1), ppmtoxpm(1), ppmtoyuv(1), ! ppmdither(1), ppmforge(1), ppmhist(1), ppmmake(1), ppmpat(1), ppmquant(1), ! ppmquantall(1), ppmrelief(1), pnm(5), pgm(5), pbm(5) .SH AUTHOR Copyright (C) 1989, 1991 by Jef Poskanzer. diff -cr pbmplus30oct91/ppm/ppm.h ppm/ppm.h *** pbmplus30oct91/ppm/ppm.h Tue Jan 22 19:43:59 1991 --- ppm/ppm.h Tue Dec 10 16:55:30 1991 *************** *** 79,87 **** #define PPM_DEPTH(newp,p,oldmaxval,newmaxval) \ PPM_ASSIGN( (newp), \ ! (int) PPM_GETR(p) * (newmaxval) / (oldmaxval), \ ! (int) PPM_GETG(p) * (newmaxval) / (oldmaxval), \ ! (int) PPM_GETB(p) * (newmaxval) / (oldmaxval) ) /* Luminance macro. */ --- 79,87 ---- #define PPM_DEPTH(newp,p,oldmaxval,newmaxval) \ PPM_ASSIGN( (newp), \ ! ( (int) PPM_GETR(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval), \ ! ( (int) PPM_GETG(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval), \ ! ( (int) PPM_GETB(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval) ) /* Luminance macro. */ diff -cr pbmplus30oct91/ppm/ppmdither.c ppm/ppmdither.c *** pbmplus30oct91/ppm/ppmdither.c Thu Sep 26 16:46:46 1991 --- ppm/ppmdither.c Tue Dec 10 16:56:47 1991 *************** *** 250,254 **** --- 250,255 ---- dith_setup(dith_dim, dith_nr, dith_ng, dith_nb, ptab); dith_dither(cols, rows, ptab, &ipixels[0][0], &opixels[0][0]); ppm_writeppm(stdout, opixels, cols, rows, maxval, 0); + pm_close(stdout); exit(0); } diff -cr pbmplus30oct91/ppm/ppmmake.1 ppm/ppmmake.1 *** pbmplus30oct91/ppm/ppmmake.1 Wed Sep 25 22:35:35 1991 --- ppm/ppmmake.1 Tue Dec 10 16:56:17 1991 *************** *** 1,7 **** .TH ppmmake 1 "24 September 1991" .IX ppmmake .SH NAME ! ppmmake - create a pixmap of a specified size .SH SYNOPSIS .B ppmmake .I color width height --- 1,7 ---- .TH ppmmake 1 "24 September 1991" .IX ppmmake .SH NAME ! ppmmake - create a pixmap of a specified size and color .SH SYNOPSIS .B ppmmake .I color width height diff -cr pbmplus30oct91/ppm/ppmmake.c ppm/ppmmake.c *** pbmplus30oct91/ppm/ppmmake.c Fri Jun 28 14:30:43 1991 --- ppm/ppmmake.c Tue Dec 10 16:56:16 1991 *************** *** 56,60 **** --- 56,61 ---- ppm_writeppmrow( stdout, pixrow, cols, PPM_MAXMAXVAL, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/ppmmerge.c ppm/ppmmerge.c *** pbmplus30oct91/ppm/ppmmerge.c Fri Sep 27 01:41:35 1991 --- ppm/ppmmerge.c Tue Dec 10 16:56:02 1991 *************** *** 32,38 **** goto again; } ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); } TRY("giftoppm", giftoppm_main); TRY("gouldtoppm", gouldtoppm_main); --- 32,38 ---- goto again; } ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); } TRY("giftoppm", giftoppm_main); TRY("gouldtoppm", gouldtoppm_main); *************** *** 45,55 **** --- 45,57 ---- TRY("picttoppm", picttoppm_main); TRY("pjtoppm", pjtoppm_main); TRY("ppmdither", ppmdither_main); + TRY("ppmforge", ppmforge_main); TRY("ppmhist", ppmhist_main); TRY("ppmmake", ppmmake_main); TRY("ppmpat", ppmpat_main); TRY("ppmquant", ppmquant_main); TRY("ppmrelief", ppmrelief_main); + TRY("ppmtoacad", ppmtoacad_main); TRY("ppmtogif", ppmtogif_main); TRY("ppmtoicr", ppmtoicr_main); TRY("ppmtoilbm", ppmtoilbm_main); *************** *** 68,73 **** --- 70,76 ---- TRY("qrttoppm", qrttoppm_main); TRY("rawtoppm", rawtoppm_main); TRY("rgb3toppm", rgb3toppm_main); + TRY("sldtoppm", sldtoppm_main); TRY("spctoppm", spctoppm_main); TRY("sputoppm", sputoppm_main); TRY("tgatoppm", tgatoppm_main); diff -cr pbmplus30oct91/ppm/ppmpat.c ppm/ppmpat.c *** pbmplus30oct91/ppm/ppmpat.c Sun Jul 7 17:29:15 1991 --- ppm/ppmpat.c Tue Dec 10 16:55:44 1991 *************** *** 187,192 **** --- 187,193 ---- /* All done, write it out. */ ppm_writeppm( stdout, pixels, cols, rows, PPM_MAXMAXVAL, 0 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/ppmquant.c ppm/ppmquant.c *** pbmplus30oct91/ppm/ppmquant.c Fri Sep 27 17:09:57 1991 --- ppm/ppmquant.c Tue Dec 10 16:55:41 1991 *************** *** 350,355 **** --- 350,357 ---- ppm_writeppmrow( stdout, pixels[row], cols, maxval, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/ppm/ppmrelief.c ppm/ppmrelief.c *** pbmplus30oct91/ppm/ppmrelief.c Sat Oct 5 22:38:29 1991 --- ppm/ppmrelief.c Tue Dec 10 16:56:36 1991 *************** *** 89,94 **** --- 89,95 ---- ppm_writeppmrow( stdout, outputrow, cols, maxval, 0 ); pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/ppmtoilbm.c ppm/ppmtoilbm.c *** pbmplus30oct91/ppm/ppmtoilbm.c Fri Jun 28 14:43:02 1991 --- ppm/ppmtoilbm.c Tue Dec 10 16:55:52 1991 *************** *** 350,355 **** unsigned char b; #endif /*__STDC__*/ { ! if ( putc( b, stdout ) == EOF ) ! pm_error( "write error" ); } --- 350,354 ---- unsigned char b; #endif /*__STDC__*/ { ! (void) putc( b, stdout ); } diff -cr pbmplus30oct91/ppm/ppmtopgm.c ppm/ppmtopgm.c *** pbmplus30oct91/ppm/ppmtopgm.c Fri Jun 28 14:30:55 1991 --- ppm/ppmtopgm.c Tue Dec 10 16:55:46 1991 *************** *** 164,169 **** --- 164,170 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/ppmtopict.c ppm/ppmtopict.c *** pbmplus30oct91/ppm/ppmtopict.c Fri Jun 28 15:34:21 1991 --- ppm/ppmtopict.c Tue Dec 10 16:56:11 1991 *************** *** 252,258 **** /* if we wrote an odd number of pixdata bytes, pad */ if (oc & 1) ! putc(0, stdout); putShort(stdout, PICT_EndOfPicture); lmaxval = ftell(stdout) - HEADER_SIZE; --- 252,258 ---- /* if we wrote an odd number of pixdata bytes, pad */ if (oc & 1) ! (void) putc(0, stdout); putShort(stdout, PICT_EndOfPicture); lmaxval = ftell(stdout) - HEADER_SIZE; *************** *** 270,276 **** register int i; for (i = 0; i < n; i++) ! putc(0, fd); } static void --- 270,276 ---- register int i; for (i = 0; i < n; i++) ! (void) putc(0, fd); } static void *************** *** 278,285 **** FILE *fd; int i; { ! putc((i >> 8) & 0xff, fd); ! putc(i & 0xff, fd); } #if __STDC__ --- 278,285 ---- FILE *fd; int i; { ! (void) putc((i >> 8) & 0xff, fd); ! (void) putc(i & 0xff, fd); } #if __STDC__ *************** *** 292,301 **** long i; #endif /*__STDC__*/ { ! putc((int)((i >> 24) & 0xff), fd); ! putc(((int)(i >> 16) & 0xff), fd); ! putc(((int)(i >> 8) & 0xff), fd); ! putc((int)(i & 0xff), fd); } static void --- 292,301 ---- long i; #endif /*__STDC__*/ { ! (void) putc((int)((i >> 24) & 0xff), fd); ! (void) putc(((int)(i >> 16) & 0xff), fd); ! (void) putc(((int)(i >> 8) & 0xff), fd); ! (void) putc((int)(i & 0xff), fd); } static void *************** *** 412,418 **** } else { ! putc(packcols, fd); oc = packcols + 1; } --- 412,418 ---- } else { ! (void) putc(packcols, fd); oc = packcols + 1; } *************** *** 420,426 **** while(p != packed) { --p; ! putc(*p, fd); } return (oc); --- 420,426 ---- while(p != packed) { --p; ! (void) putc(*p, fd); } return (oc); *************** *** 450,456 **** } else { ! putc(bc, fd); oc = bc + 1; } for (i = 0, pP = rowpixels; i < cols;) --- 450,456 ---- } else { ! (void) putc(bc, fd); oc = bc + 1; } for (i = 0, pP = rowpixels; i < cols;) *************** *** 457,466 **** { if (cols - i > MAX_COUNT) { ! putc(MAX_COUNT - 1, fd); for (j = 0; j < MAX_COUNT; j++) { ! putc(ppm_lookupcolor(cht, pP), fd); pP++; } i += MAX_COUNT; --- 457,466 ---- { if (cols - i > MAX_COUNT) { ! (void) putc(MAX_COUNT - 1, fd); for (j = 0; j < MAX_COUNT; j++) { ! (void) putc(ppm_lookupcolor(cht, pP), fd); pP++; } i += MAX_COUNT; *************** *** 467,476 **** } else { ! putc(cols - i - 1, fd); for (j = 0; j < cols - i; j++) { ! putc(ppm_lookupcolor(cht, pP), fd); pP++; } i = cols; --- 467,476 ---- } else { ! (void) putc(cols - i - 1, fd); for (j = 0; j < cols - i; j++) { ! (void) putc(ppm_lookupcolor(cht, pP), fd); pP++; } i = cols; diff -cr pbmplus30oct91/ppm/ppmtotga.c ppm/ppmtotga.c *** pbmplus30oct91/ppm/ppmtotga.c Wed Oct 30 10:56:22 1991 --- ppm/ppmtotga.c Tue Dec 10 16:56:49 1991 *************** *** 212,217 **** --- 212,218 ---- tgaHeader.AttBits = 0; tgaHeader.Rsrvd = 0; tgaHeader.IntrLve = 0; + tgaHeader.OrgBit = 0; /* Write out the Targa header. */ writetga( &tgaHeader, (char*) 0 ); diff -cr pbmplus30oct91/ppm/ppmtouil.c ppm/ppmtouil.c *** pbmplus30oct91/ppm/ppmtouil.c Tue Jul 23 10:36:32 1991 --- ppm/ppmtouil.c Tue Dec 10 16:56:22 1991 *************** *** 86,93 **** (void) strcpy( out_name, "noname" ); /* Remove trailing _icon in name. */ cp = rindex( out_name, '_' ); ! if ( cp[1] == 'i' && cp[2] == 'c' && cp[3] == 'o' && cp[4] == 'n' && ! cp[5] == '\0' ) *cp = '\0'; } ++argn; --- 86,94 ---- (void) strcpy( out_name, "noname" ); /* Remove trailing _icon in name. */ cp = rindex( out_name, '_' ); ! if ( cp != (char*) 0 && ! cp[1] == 'i' && cp[2] == 'c' && cp[3] == 'o' && ! cp[4] == 'n' && cp[5] == '\0' ) *cp = '\0'; } ++argn; diff -cr pbmplus30oct91/ppm/qrttoppm.c ppm/qrttoppm.c *** pbmplus30oct91/ppm/qrttoppm.c Fri Jun 28 14:31:05 1991 --- ppm/qrttoppm.c Tue Dec 10 16:55:48 1991 *************** *** 62,67 **** --- 62,68 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/rawtoppm.c ppm/rawtoppm.c *** pbmplus30oct91/ppm/rawtoppm.c Fri Jun 28 14:31:07 1991 --- ppm/rawtoppm.c Tue Dec 10 16:55:54 1991 *************** *** 220,226 **** --- 220,228 ---- } ppm_writeppmrow( stdout, pixrow, cols, (pixval) 255, 0 ); } + pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/rgb3toppm.c ppm/rgb3toppm.c *** pbmplus30oct91/ppm/rgb3toppm.c Fri Jun 28 14:31:08 1991 --- ppm/rgb3toppm.c Tue Dec 10 16:56:03 1991 *************** *** 81,86 **** --- 81,87 ---- pm_close( rfd ); pm_close( gfd ); pm_close( bfd ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/spctoppm.c ppm/spctoppm.c *** pbmplus30oct91/ppm/spctoppm.c Fri Sep 27 17:21:41 1991 --- ppm/spctoppm.c Tue Dec 10 16:56:39 1991 *************** *** 107,112 **** --- 107,114 ---- ppm_writeppmrow( stdout, pixelrow, COLS, (pixval) MAXVAL, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/ppm/sputoppm.c ppm/sputoppm.c *** pbmplus30oct91/ppm/sputoppm.c Fri Sep 27 17:23:57 1991 --- ppm/sputoppm.c Tue Dec 10 16:56:41 1991 *************** *** 100,104 **** --- 100,106 ---- ppm_writeppmrow( stdout, pixelrow, COLS, (pixval) MAXVAL, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/ppm/tgatoppm.c ppm/tgatoppm.c *** pbmplus30oct91/ppm/tgatoppm.c Wed Oct 30 09:38:05 1991 --- ppm/tgatoppm.c Tue Dec 10 16:55:56 1991 *************** *** 208,213 **** --- 208,214 ---- pm_close( ifp ); ppm_writeppm( stdout, pixels, cols, rows, (pixval) maxval, 0 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/ximtoppm.c ppm/ximtoppm.c *** pbmplus30oct91/ppm/ximtoppm.c Fri Jun 28 14:43:15 1991 --- ppm/ximtoppm.c Tue Dec 10 16:56:06 1991 *************** *** 104,109 **** --- 104,110 ---- ppm_writeppmrow( stdout, pixelrow, cols, maxval, 0 ); } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/ppm/xpmtoppm.c ppm/xpmtoppm.c *** pbmplus30oct91/ppm/xpmtoppm.c Fri Jun 28 14:43:17 1991 --- ppm/xpmtoppm.c Tue Dec 10 16:56:18 1991 *************** *** 56,61 **** --- 56,63 ---- ppm_writeppmrow( stdout, pixrow, cols, (pixval) PPM_MAXMAXVAL, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/ppm/yuvtoppm.c ppm/yuvtoppm.c *** pbmplus30oct91/ppm/yuvtoppm.c Fri Sep 27 01:38:13 1991 --- ppm/yuvtoppm.c Tue Dec 10 16:56:54 1991 *************** *** 95,100 **** --- 95,101 ---- ppm_writeppmrow(stdout, pixrow, cols, (pixval) 255, 0); } pm_close(ifp); + pm_close(stdout); exit(0); } diff -cr pbmplus30oct91/pnm/pnmarith.c pnm/pnmarith.c *** pbmplus30oct91/pnm/pnmarith.c Mon Sep 23 15:12:06 1991 --- pnm/pnmarith.c Tue Dec 10 16:55:01 1991 *************** *** 189,194 **** --- 189,195 ---- pm_close( ifp1 ); pm_close( ifp2 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmcat.c pnm/pnmcat.c *** pbmplus30oct91/pnm/pnmcat.c Fri Jun 28 14:29:45 1991 --- pnm/pnmcat.c Tue Dec 10 16:54:24 1991 *************** *** 240,245 **** --- 240,246 ---- for ( i = 0; i < nfiles; ++i ) pm_close( ifp[i] ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmconvol.1 pnm/pnmconvol.1 *** pbmplus30oct91/pnm/pnmconvol.1 Tue Jun 4 14:08:20 1991 --- pnm/pnmconvol.1 Tue Dec 10 16:55:03 1991 *************** *** 20,26 **** convolution file are only relative. .PP Here is a sample convolution file; ! it does a simple average of the immediate neighbors, resulting in a smoothed image: .nf P2 --- 20,26 ---- convolution file are only relative. .PP Here is a sample convolution file; ! it does a simple average of the nine immediate neighbors, resulting in a smoothed image: .nf P2 *************** *** 31,42 **** 10 10 10 .fi .PP ! The convolution file will usually be a bitmap or graymap instead of a pixmap, so that the same convolution gets applied to each color component. However, if you want to use a pixmap and do a different convolution to different colors, you can certainly do that. .SH "SEE ALSO" ! pnm(5) .SH AUTHOR Copyright (C) 1989, 1991 by Jef Poskanzer. .\" Permission to use, copy, modify, and distribute this software and its --- 31,50 ---- 10 10 10 .fi .PP ! To see how this works, do the above-mentioned offset: 10 - 18/2 gives 1. ! The possible range of values is from 0 to 18, and after the offset ! that's -9 to 9. The normalization step makes the range -1 to 1, and ! the values get scaled correspondingly so they become 1/9 - exactly what ! you want. ! The equivalent matrix for 5x5 smoothing would have maxval 50 and be ! filled with 26. ! .PP ! The convolution file will usually be a graymap, so that the same convolution gets applied to each color component. However, if you want to use a pixmap and do a different convolution to different colors, you can certainly do that. .SH "SEE ALSO" ! pnmsmooth(1), pnm(5) .SH AUTHOR Copyright (C) 1989, 1991 by Jef Poskanzer. .\" Permission to use, copy, modify, and distribute this software and its diff -cr pbmplus30oct91/pnm/pnmconvol.c pnm/pnmconvol.c *** pbmplus30oct91/pnm/pnmconvol.c Mon Sep 23 15:13:44 1991 --- pnm/pnmconvol.c Tue Dec 10 16:55:03 1991 *************** *** 214,218 **** --- 214,219 ---- pnm_writepnmrow( stdout, xelbuf[(row-crowso2) % crows], cols, maxval, newformat, 0 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmcrop.c pnm/pnmcrop.c *** pbmplus30oct91/pnm/pnmcrop.c Fri Jun 28 14:29:47 1991 --- pnm/pnmcrop.c Tue Dec 10 16:54:57 1991 *************** *** 131,136 **** --- 131,137 ---- pnm_writepnminit( stdout, newcols, newrows, maxval, format, 0 ); for ( row = top; row <= bottom; row++ ) pnm_writepnmrow( stdout, &(xels[row][left]), newcols, maxval, format, 0 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmcut.c pnm/pnmcut.c *** pbmplus30oct91/pnm/pnmcut.c Fri Jun 28 14:42:30 1991 --- pnm/pnmcut.c Tue Dec 10 16:54:27 1991 *************** *** 84,89 **** --- 84,90 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmdepth.c pnm/pnmdepth.c *** pbmplus30oct91/pnm/pnmdepth.c Mon Sep 23 15:14:12 1991 --- pnm/pnmdepth.c Tue Dec 10 16:55:16 1991 *************** *** 24,30 **** register xel* xP; int argn, rows, cols, format, newformat, row; register int col; ! xelval maxval, newmaxval; int i; char* usage = "newmaxval [pnmfile]"; --- 24,31 ---- register xel* xP; int argn, rows, cols, format, newformat, row; register int col; ! xelval maxval; ! int newmaxval; int i; char* usage = "newmaxval [pnmfile]"; *************** *** 34,45 **** if ( argn == argc ) pm_usage( usage ); ! if ( sscanf( argv[argn], "%d", &i ) != 1 ) pm_usage( usage ); - newmaxval = i; ++argn; if ( newmaxval < 1 ) ! pm_error( "newmaxval must be > 1" ); if ( argn != argc ) { --- 35,48 ---- if ( argn == argc ) pm_usage( usage ); ! if ( sscanf( argv[argn], "%d", &newmaxval ) != 1 ) pm_usage( usage ); ++argn; if ( newmaxval < 1 ) ! pm_error( "newmaxval must be >= 1" ); ! if ( newmaxval > PNM_MAXMAXVAL ) ! pm_error( ! "newmaxval is too large - try reconfiguring with PGM_BIGGRAYS\n or without PPM_PACKCOLORS" ); if ( argn != argc ) { *************** *** 65,71 **** newformat = format; for ( i = 0; i <= maxval; ++i ) ! newvals[i] = i * newmaxval / maxval; pnm_writepnminit( stdout, cols, rows, newmaxval, newformat, 0 ); --- 68,74 ---- newformat = format; for ( i = 0; i <= maxval; ++i ) ! newvals[i] = ( i * newmaxval + maxval / 2 ) / maxval; pnm_writepnminit( stdout, cols, rows, newmaxval, newformat, 0 ); *************** *** 92,97 **** --- 95,101 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmenlarge.c pnm/pnmenlarge.c *** pbmplus30oct91/pnm/pnmenlarge.c Fri Jun 28 14:29:50 1991 --- pnm/pnmenlarge.c Tue Dec 10 16:54:36 1991 *************** *** 71,76 **** --- 71,77 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmflip.c pnm/pnmflip.c *** pbmplus30oct91/pnm/pnmflip.c Fri Jun 28 14:29:53 1991 --- pnm/pnmflip.c Tue Dec 10 16:54:29 1991 *************** *** 190,195 **** --- 190,196 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmgamma.c pnm/pnmgamma.c *** pbmplus30oct91/pnm/pnmgamma.c Mon Sep 23 15:17:45 1991 --- pnm/pnmgamma.c Tue Dec 10 16:54:59 1991 *************** *** 147,152 **** --- 147,153 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnminvert.c pnm/pnminvert.c *** pbmplus30oct91/pnm/pnminvert.c Fri Jun 28 14:29:55 1991 --- pnm/pnminvert.c Tue Dec 10 16:54:31 1991 *************** *** 47,52 **** --- 47,53 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmmerge.c pnm/pnmmerge.c *** pbmplus30oct91/pnm/pnmmerge.c Wed Sep 25 23:57:35 1991 --- pnm/pnmmerge.c Tue Dec 10 16:54:37 1991 *************** *** 32,38 **** goto again; } ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); } TRY("pnmarith", pnmarith_main); TRY("pnmcat", pnmcat_main); --- 32,38 ---- goto again; } ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); } TRY("pnmarith", pnmarith_main); TRY("pnmcat", pnmcat_main); diff -cr pbmplus30oct91/pnm/pnmnoraw.c pnm/pnmnoraw.c *** pbmplus30oct91/pnm/pnmnoraw.c Fri Jun 28 14:29:58 1991 --- pnm/pnmnoraw.c Tue Dec 10 16:54:38 1991 *************** *** 43,48 **** --- 43,49 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmpaste.c pnm/pnmpaste.c *** pbmplus30oct91/pnm/pnmpaste.c Fri Jun 28 15:58:04 1991 --- pnm/pnmpaste.c Tue Dec 10 16:54:33 1991 *************** *** 178,183 **** --- 178,184 ---- pm_close( ifp1 ); pm_close( ifp2 ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmrotate.c pnm/pnmrotate.c *** pbmplus30oct91/pnm/pnmrotate.c Mon Sep 23 15:19:49 1991 --- pnm/pnmrotate.c Tue Dec 10 16:55:10 1991 *************** *** 326,330 **** --- 326,332 ---- pnm_writepnmrow( stdout, newxelrow, newcols, maxval, newformat, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmscale.c pnm/pnmscale.c *** pbmplus30oct91/pnm/pnmscale.c Mon Sep 23 15:21:15 1991 --- pnm/pnmscale.c Tue Dec 10 16:55:12 1991 *************** *** 428,433 **** --- 428,434 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmshear.c pnm/pnmshear.c *** pbmplus30oct91/pnm/pnmshear.c Mon Sep 23 15:22:00 1991 --- pnm/pnmshear.c Tue Dec 10 16:55:14 1991 *************** *** 168,173 **** --- 168,174 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmtile.c pnm/pnmtile.c *** pbmplus30oct91/pnm/pnmtile.c Fri Jun 28 14:30:06 1991 --- pnm/pnmtile.c Tue Dec 10 16:54:34 1991 *************** *** 57,61 **** --- 57,63 ---- pnm_writepnmrow( stdout, xelrow, width, maxval, format, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/pnm/pnmtotiff.c pnm/pnmtotiff.c *** pbmplus30oct91/pnm/pnmtotiff.c Wed Sep 25 23:43:22 1991 --- pnm/pnmtotiff.c Tue Dec 10 16:55:08 1991 *************** *** 140,145 **** --- 140,146 ---- pm_message( "If you want an 8-bit palette file, try doing a 'ppmquant %d'.", MAXCOLORS ); + grayscale = 0; } else { *************** *** 162,167 **** --- 163,169 ---- break; default: + chv = (colorhist_vector) 0; grayscale = 1; break; } diff -cr pbmplus30oct91/pnm/pnmtoxwd.c pnm/pnmtoxwd.c *** pbmplus30oct91/pnm/pnmtoxwd.c Sat Oct 5 23:13:09 1991 --- pnm/pnmtoxwd.c Tue Dec 10 16:54:54 1991 *************** *** 255,262 **** pm_writebigshort( stdout, color.red ); pm_writebigshort( stdout, color.green ); pm_writebigshort( stdout, color.blue ); ! putc( color.flags, stdout ); ! putc( color.pad, stdout ); } } --- 255,262 ---- pm_writebigshort( stdout, color.red ); pm_writebigshort( stdout, color.green ); pm_writebigshort( stdout, color.blue ); ! (void) putc( color.flags, stdout ); ! (void) putc( color.pad, stdout ); } } diff -cr pbmplus30oct91/pnm/rasttopnm.c pnm/rasttopnm.c *** pbmplus30oct91/pnm/rasttopnm.c Sat Oct 5 23:02:38 1991 --- pnm/rasttopnm.c Tue Dec 10 16:54:49 1991 *************** *** 254,258 **** --- 254,260 ---- pnm_writepnmrow( stdout, xelrow, cols, maxval, format, 0 ); } + pm_close( stdout ); + exit( 0 ); } diff -cr pbmplus30oct91/pnm/tifftopnm.c pnm/tifftopnm.c *** pbmplus30oct91/pnm/tifftopnm.c Thu Oct 24 16:10:55 1991 --- pnm/tifftopnm.c Tue Dec 10 16:55:06 1991 *************** *** 271,275 **** --- 271,276 ---- pnm_writepnmrow( stdout, xelrow, cols, (xelval) maxval, format, 0 ); } + pm_close( stdout ); exit( 0 ); } diff -cr pbmplus30oct91/pnm/xwdtopnm.c pnm/xwdtopnm.c *** pbmplus30oct91/pnm/xwdtopnm.c Thu Sep 26 19:33:50 1991 --- pnm/xwdtopnm.c Tue Dec 10 16:54:52 1991 *************** *** 19,24 **** --- 19,33 ---- static short bs_short ARGS(( short s )); static long bs_long ARGS(( long l )); + static unsigned long red_mask, green_mask, blue_mask; + static int bits_per_item, bits_used, bit_shift, bits_per_pixel; + static char buf[4]; + static char* byteP; + static short* shortP; + static long* longP; + static unsigned long pixel_mask; + static int byte_swap, byte_order, bit_order; + void main( argc, argv ) int argc; *************** *** 83,91 **** register unsigned long ul; ul = getpixnum( ifp ); ! PPM_ASSIGN( *xP, ( ( ul & 0xff0000 ) >> 16 ), ! ( ( ul & 0xff00 ) >> 8 ), ! ( ul & 0xff ) ); } break; --- 92,116 ---- register unsigned long ul; ul = getpixnum( ifp ); ! switch ( bits_per_pixel ) ! { ! case 16: ! PPM_ASSIGN( *xP, ! ( ( ul & red_mask ) >> 0 ), ! ( ( ul & green_mask ) >> 5 ), ! ( ( ul & blue_mask ) >> 10 ) ); ! break; ! ! case 24: ! case 32: ! PPM_ASSIGN( *xP, ( ( ul & 0xff0000 ) >> 16 ), ! ( ( ul & 0xff00 ) >> 8 ), ! ( ul & 0xff ) ); ! break; ! ! default: ! pm_error( "True/Direct only supports 16, 24, and 32 bits" ); ! } } break; *************** *** 98,115 **** } pm_close( ifp ); exit( 0 ); } - static char buf[4]; - static char* byteP; - static short* shortP; - static long* longP; - static int bits_per_item, bits_used, bit_shift, bits_per_pixel; - static unsigned long pixel_mask; - static int byte_swap, byte_order, bit_order; - static void getinit( file, colsP, rowsP, padrightP, maxvalP, visualclassP, formatP, colorsP ) FILE* file; --- 123,133 ---- } pm_close( ifp ); + pm_close( stdout ); exit( 0 ); } static void getinit( file, colsP, rowsP, padrightP, maxvalP, visualclassP, formatP, colorsP ) FILE* file; *************** *** 363,369 **** if ( *visualclassP == TrueColor || *visualclassP == DirectColor ) { *formatP = PPM_TYPE; ! *maxvalP = 255; } else if ( *visualclassP == StaticGray && h11P->bits_per_pixel == 1 ) { --- 381,390 ---- if ( *visualclassP == TrueColor || *visualclassP == DirectColor ) { *formatP = PPM_TYPE; ! if ( h11P->bits_per_pixel == 16 ) ! *maxvalP = 31; ! else ! *maxvalP = 255; } else if ( *visualclassP == StaticGray && h11P->bits_per_pixel == 1 ) { *************** *** 414,419 **** --- 435,443 ---- pixel_mask = -1; else pixel_mask = ( 1 << bits_per_pixel ) - 1; + red_mask = h11P->red_mask; + green_mask = h11P->green_mask; + blue_mask = h11P->blue_mask; } else pm_error( "unknown XWD file version: %d", h11P->file_version );