home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-12-14 | 55.2 KB | 2,000 lines |
- Newsgroups: comp.sources.misc
- From: jef@well.sf.ca.us (Jef Poskanzer)
- Subject: v26i107: pbmplus - Extended Portable Bitmap Toolkit, Patch10dec91, Part02/05
- Message-ID: <1991Dec15.014542.20374@sparky.imd.sterling.com>
- X-Md4-Signature: abfe7210d50de8e32a89e8bdddc36db6
- Date: Sun, 15 Dec 1991 01:45:42 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: jef@well.sf.ca.us (Jef Poskanzer)
- Posting-number: Volume 26, Issue 107
- Archive-name: pbmplus/patch10dec91/part02
- Environment: UNIX
- Patch-To: pbmplus: Volume 23, Issue 36-59
-
- #!/bin/sh
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file p121091.diffs continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 2; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping p121091.diffs'
- else
- echo 'x - continuing file p121091.diffs'
- sed 's/^X//' << 'SHAR_EOF' >> 'p121091.diffs' &&
- X ppmtopj ppmtopuzz ppmtorgb3 ppmtosixel \
- X ppmtotga ppmtouil ppmtoxpm ppmtoyuv qrttoppm \
- ! rawtoppm rgb3toppm sldtoppm spctoppm sputoppm \
- X tgatoppm ximtoppm xpmtoppm yuvtoppm
- ! MATHBINARIES = ppmforge ppmpat
- X BINARIES = $(PORTBINARIES) $(MATHBINARIES)
- X SCRIPTS = ppmquantall
- X
- X OBJECTS = giftoppm.o gouldtoppm.o ilbmtoppm.o imgtoppm.o mtvtoppm.o \
- X 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 \
- X ppmtopj.o ppmtopuzz.o ppmtorgb3.o ppmtosixel.o \
- X ppmtotga.o ppmtouil.o ppmtoxpm.o ppmtoyuv.o qrttoppm.o \
- ! rawtoppm.o rgb3toppm.o sldtoppm.o spctoppm.o sputoppm.o \
- X tgatoppm.o ximtoppm.o xpmtoppm.o yuvtoppm.o \
- ! ppmforge.o ppmpat.o
- X
- X MANUALS1 = $(BINARIES) $(SCRIPTS)
- X MANUALS3 = libppm
- ***************
- *** 167,177 ****
- --- 167,179 ----
- X picttoppm picttoppm.o: picttoppm.c
- X pjtoppm pjtoppm.o: pjtoppm.c
- X ppmdither ppmdither.o: ppmdither.c
- + ppmforge ppmforge.o: ppmforge.c
- X ppmhist ppmhist.o: ppmhist.c ppmcmap.h
- X ppmmake ppmmake.o: ppmmake.c
- X ppmpat ppmpat.o: ppmpat.c ppmdraw.h
- X ppmquant ppmquant.o: ppmquant.c $(PGMDIR)/dithers.h ppmcmap.h
- X ppmrelief ppmrelief.o: ppmrelief.c
- + ppmtoacad ppmtoacad.o: ppmtoacad.c ppmcmap.h autocad.h
- X ppmtogif ppmtogif.o: ppmtogif.c ppmcmap.h
- X ppmtoicr ppmtoicr.o: ppmtoicr.c ppmcmap.h
- X ppmtoilbm ppmtoilbm.o: ppmtoilbm.c ilbm.h ppmcmap.h
- ***************
- *** 190,195 ****
- --- 192,198 ----
- X qrttoppm qrttoppm.o: qrttoppm.c
- X rawtoppm rawtoppm.o: rawtoppm.c
- X rgb3toppm rgb3toppm.o: rgb3toppm.c
- + sldtoppm sldtoppm.o: sldtoppm.c ppmdraw.h autocad.h
- X spctoppm spctoppm.o: spctoppm.c
- X sputoppm sputoppm.o: sputoppm.c
- X 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 ----
- X
- X ReadGIF(in, imageNumber);
- X pm_close(in);
- + pm_close(stdout);
- X exit(0);
- X }
- X
- ***************
- *** 286,293 ****
- X break;
- X }
- X
- ! pm_message("got a '%s' extension - please report this to koblas@mips.com",
- ! str );
- X
- X while (GetDataBlock(fd, (unsigned char*) buf) != 0)
- X ;
- --- 287,293 ----
- X break;
- X }
- X
- ! pm_message("got a '%s' extension", str );
- X
- X while (GetDataBlock(fd, (unsigned char*) buf) != 0)
- X ;
- 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 ----
- X }
- X
- X pm_close(ifp);
- + pm_close(stdout);
- X
- X exit(0);
- X }
- 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 ----
- X ppm_writeppmrow( stdout, pixelrow, cols, (pixval) maxval, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- X
- 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 ----
- X ppm_writeppmrow( stdout, pixelrow, cols, maxval, 0 );
- X }
- X pm_close( ifp );
- + pm_close( stdout );
- X exit( 0 );
- X }
- X }
- 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 ****
- X #endif /*PBMPLUS_RAWBITS*/
- X }
- X
- ! static int
- X putus( n, file )
- X unsigned short n;
- X FILE* file;
- X {
- X if ( n >= 10 )
- ! if ( putus( n / 10, file ) == EOF )
- ! return EOF;
- ! return putc( n % 10 + '0', file );
- X }
- X
- X #ifdef PBMPLUS_RAWBITS
- --- 41,54 ----
- X #endif /*PBMPLUS_RAWBITS*/
- X }
- X
- ! static void
- X putus( n, file )
- X unsigned short n;
- X FILE* file;
- X {
- X if ( n >= 10 )
- ! putus( n / 10, file );
- ! (void) putc( n % 10 + '0', file );
- X }
- X
- X #ifdef PBMPLUS_RAWBITS
- ***************
- *** 71,92 ****
- X if ( val > maxval )
- X pm_error( "r value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! if ( putc( val, file ) == EOF )
- ! pm_error( "write error" );
- X val = PPM_GETG( *pP );
- X #ifdef DEBUG
- X if ( val > maxval )
- X pm_error( "g value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! if ( putc( val, file ) == EOF )
- ! pm_error( "write error" );
- X val = PPM_GETB( *pP );
- X #ifdef DEBUG
- X if ( val > maxval )
- X pm_error( "b value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! if ( putc( val, file ) == EOF )
- ! pm_error( "write error" );
- X }
- X }
- X #endif /*PBMPLUS_RAWBITS*/
- --- 70,88 ----
- X if ( val > maxval )
- X pm_error( "r value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! (void) putc( val, file );
- X val = PPM_GETG( *pP );
- X #ifdef DEBUG
- X if ( val > maxval )
- X pm_error( "g value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! (void) putc( val, file );
- X val = PPM_GETB( *pP );
- X #ifdef DEBUG
- X if ( val > maxval )
- X pm_error( "b value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! (void) putc( val, file );
- X }
- X }
- X #endif /*PBMPLUS_RAWBITS*/
- ***************
- *** 107,122 ****
- X {
- X if ( charcount >= 65 )
- X {
- ! if ( putc( '\n', file ) == EOF )
- ! pm_error( "write error" );
- X charcount = 0;
- X }
- X else if ( charcount > 0 )
- X {
- ! if ( putc( ' ', file ) == EOF )
- ! pm_error( "write error" );
- ! if ( putc( ' ', file ) == EOF )
- ! pm_error( "write error" );
- X charcount += 2;
- X }
- X val = PPM_GETR( *pP );
- --- 103,115 ----
- X {
- X if ( charcount >= 65 )
- X {
- ! (void) putc( '\n', file );
- X charcount = 0;
- X }
- X else if ( charcount > 0 )
- X {
- ! (void) putc( ' ', file );
- ! (void) putc( ' ', file );
- X charcount += 2;
- X }
- X val = PPM_GETR( *pP );
- ***************
- *** 124,154 ****
- X if ( val > maxval )
- X pm_error( "r value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! if ( putus( val, file ) == EOF )
- ! pm_error( "write error" );
- ! if ( putc( ' ', file ) == EOF )
- ! pm_error( "write error" );
- X val = PPM_GETG( *pP );
- X #ifdef DEBUG
- X if ( val > maxval )
- X pm_error( "g value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! if ( putus( val, file ) == EOF )
- ! pm_error( "write error" );
- ! if ( putc( ' ', file ) == EOF )
- ! pm_error( "write error" );
- X val = PPM_GETB( *pP );
- X #ifdef DEBUG
- X if ( val > maxval )
- X pm_error( "b value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! if ( putus( val, file ) == EOF )
- ! pm_error( "write error" );
- X charcount += 11;
- X }
- X if ( charcount > 0 )
- ! if ( putc( '\n', file ) == EOF )
- ! pm_error( "write error" );
- X }
- X
- X #if __STDC__
- --- 117,141 ----
- X if ( val > maxval )
- X pm_error( "r value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! putus( val, file );
- ! (void) putc( ' ', file );
- X val = PPM_GETG( *pP );
- X #ifdef DEBUG
- X if ( val > maxval )
- X pm_error( "g value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! putus( val, file );
- ! (void) putc( ' ', file );
- X val = PPM_GETB( *pP );
- X #ifdef DEBUG
- X if ( val > maxval )
- X pm_error( "b value out of bounds (%u > %u)", val, maxval );
- X #endif /*DEBUG*/
- ! putus( val, file );
- X charcount += 11;
- X }
- X if ( charcount > 0 )
- ! (void) putc( '\n', file );
- X }
- X
- X #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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X
- X ppm_writeppm(stdout, pixels, Width, Height, (pixval) 255, 0 );
- X
- + pm_close(stdout);
- +
- X exit(0);
- X }
- X
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X ppm_writeppmrow( stdout, pixelrow, COLS, (pixval) MAXVAL, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- 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 ----
- X
- X ppm_writeppmrow(stdout, pixelrow, width, (pixval) 255, 0 );
- X }
- + pm_close(stdout);
- X }
- X
- X /*
- 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 ----
- X }
- X ppm_writeppmrow(stdout, pixrow, cols, (pixval) 255, 0);
- X }
- + pm_close(stdout);
- X exit(0);
- X }
- 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 ****
- X .SH "SEE ALSO"
- X giftoppm(1), gouldtoppm(1), ilbmtoppm(1), imgtoppm(1), mtvtoppm(1),
- X pcxtoppm(1), pgmtoppm(1), pi1toppm(1), picttoppm(1), pjtoppm(1), qrttoppm(1),
- ! rawtoppm(1), rgb3toppm(1), spctoppm(1), sputoppm(1), tgatoppm(1),
- X ximtoppm(1), xpmtoppm(1), yuvtoppm(1),
- ! ppmtogif(1), ppmtoicr(1), ppmtoilbm(1), ppmtopcx(1), ppmtopgm(1),
- X ppmtopi1(1), ppmtopict(1), ppmtopj(1), ppmtopuzz(1), ppmtorgb3(1),
- X ppmtosixel(1), ppmtotga(1), ppmtouil(1), ppmtoxpm(1), ppmtoyuv(1),
- ! ppmdither(1), ppmhist(1), ppmmake(1), ppmpat(1), ppmquant(1), ppmquantall(1),
- ! ppmrelief(1),
- X pnm(5), pgm(5), pbm(5)
- X .SH AUTHOR
- X Copyright (C) 1989, 1991 by Jef Poskanzer.
- --- 75,87 ----
- X .SH "SEE ALSO"
- X giftoppm(1), gouldtoppm(1), ilbmtoppm(1), imgtoppm(1), mtvtoppm(1),
- X pcxtoppm(1), pgmtoppm(1), pi1toppm(1), picttoppm(1), pjtoppm(1), qrttoppm(1),
- ! rawtoppm(1), rgb3toppm(1), sldtoppm(1), spctoppm(1), sputoppm(1), tgatoppm(1),
- X ximtoppm(1), xpmtoppm(1), yuvtoppm(1),
- ! ppmtoacad(1), ppmtogif(1), ppmtoicr(1), ppmtoilbm(1), ppmtopcx(1), ppmtopgm(1),
- X ppmtopi1(1), ppmtopict(1), ppmtopj(1), ppmtopuzz(1), ppmtorgb3(1),
- X 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),
- X pnm(5), pgm(5), pbm(5)
- X .SH AUTHOR
- X 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 ****
- X
- X #define PPM_DEPTH(newp,p,oldmaxval,newmaxval) \
- X PPM_ASSIGN( (newp), \
- ! (int) PPM_GETR(p) * (newmaxval) / (oldmaxval), \
- ! (int) PPM_GETG(p) * (newmaxval) / (oldmaxval), \
- ! (int) PPM_GETB(p) * (newmaxval) / (oldmaxval) )
- X
- X
- X /* Luminance macro. */
- --- 79,87 ----
- X
- X #define PPM_DEPTH(newp,p,oldmaxval,newmaxval) \
- X 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) )
- X
- X
- X /* 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 ----
- X dith_setup(dith_dim, dith_nr, dith_ng, dith_nb, ptab);
- X dith_dither(cols, rows, ptab, &ipixels[0][0], &opixels[0][0]);
- X ppm_writeppm(stdout, opixels, cols, rows, maxval, 0);
- + pm_close(stdout);
- X exit(0);
- X }
- 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 ****
- X .TH ppmmake 1 "24 September 1991"
- X .IX ppmmake
- X .SH NAME
- ! ppmmake - create a pixmap of a specified size
- X .SH SYNOPSIS
- X .B ppmmake
- X .I color width height
- --- 1,7 ----
- X .TH ppmmake 1 "24 September 1991"
- X .IX ppmmake
- X .SH NAME
- ! ppmmake - create a pixmap of a specified size and color
- X .SH SYNOPSIS
- X .B ppmmake
- X .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 ----
- X ppm_writeppmrow( stdout, pixrow, cols, PPM_MAXMAXVAL, 0 );
- X }
- X
- + pm_close( stdout );
- X exit( 0 );
- X }
- 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 ****
- X goto again;
- X }
- X
- ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); }
- X
- X TRY("giftoppm", giftoppm_main);
- X TRY("gouldtoppm", gouldtoppm_main);
- --- 32,38 ----
- X goto again;
- X }
- X
- ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); }
- X
- X TRY("giftoppm", giftoppm_main);
- X TRY("gouldtoppm", gouldtoppm_main);
- ***************
- *** 45,55 ****
- --- 45,57 ----
- X TRY("picttoppm", picttoppm_main);
- X TRY("pjtoppm", pjtoppm_main);
- X TRY("ppmdither", ppmdither_main);
- + TRY("ppmforge", ppmforge_main);
- X TRY("ppmhist", ppmhist_main);
- X TRY("ppmmake", ppmmake_main);
- X TRY("ppmpat", ppmpat_main);
- X TRY("ppmquant", ppmquant_main);
- X TRY("ppmrelief", ppmrelief_main);
- + TRY("ppmtoacad", ppmtoacad_main);
- X TRY("ppmtogif", ppmtogif_main);
- X TRY("ppmtoicr", ppmtoicr_main);
- X TRY("ppmtoilbm", ppmtoilbm_main);
- ***************
- *** 68,73 ****
- --- 70,76 ----
- X TRY("qrttoppm", qrttoppm_main);
- X TRY("rawtoppm", rawtoppm_main);
- X TRY("rgb3toppm", rgb3toppm_main);
- + TRY("sldtoppm", sldtoppm_main);
- X TRY("spctoppm", spctoppm_main);
- X TRY("sputoppm", sputoppm_main);
- X 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 ----
- X
- X /* All done, write it out. */
- X ppm_writeppm( stdout, pixels, cols, rows, PPM_MAXMAXVAL, 0 );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X ppm_writeppmrow( stdout, pixels[row], cols, maxval, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- X
- 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 ----
- X ppm_writeppmrow( stdout, outputrow, cols, maxval, 0 );
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ****
- X unsigned char b;
- X #endif /*__STDC__*/
- X {
- ! if ( putc( b, stdout ) == EOF )
- ! pm_error( "write error" );
- X }
- --- 350,354 ----
- X unsigned char b;
- X #endif /*__STDC__*/
- X {
- ! (void) putc( b, stdout );
- X }
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ****
- X
- X /* if we wrote an odd number of pixdata bytes, pad */
- X if (oc & 1)
- ! putc(0, stdout);
- X putShort(stdout, PICT_EndOfPicture);
- X
- X lmaxval = ftell(stdout) - HEADER_SIZE;
- --- 252,258 ----
- X
- X /* if we wrote an odd number of pixdata bytes, pad */
- X if (oc & 1)
- ! (void) putc(0, stdout);
- X putShort(stdout, PICT_EndOfPicture);
- X
- X lmaxval = ftell(stdout) - HEADER_SIZE;
- ***************
- *** 270,276 ****
- X register int i;
- X
- X for (i = 0; i < n; i++)
- ! putc(0, fd);
- X }
- X
- X static void
- --- 270,276 ----
- X register int i;
- X
- X for (i = 0; i < n; i++)
- ! (void) putc(0, fd);
- X }
- X
- X static void
- ***************
- *** 278,285 ****
- X FILE *fd;
- X int i;
- X {
- ! putc((i >> 8) & 0xff, fd);
- ! putc(i & 0xff, fd);
- X }
- X
- X #if __STDC__
- --- 278,285 ----
- X FILE *fd;
- X int i;
- X {
- ! (void) putc((i >> 8) & 0xff, fd);
- ! (void) putc(i & 0xff, fd);
- X }
- X
- X #if __STDC__
- ***************
- *** 292,301 ****
- X long i;
- X #endif /*__STDC__*/
- X {
- ! putc((int)((i >> 24) & 0xff), fd);
- ! putc(((int)(i >> 16) & 0xff), fd);
- ! putc(((int)(i >> 8) & 0xff), fd);
- ! putc((int)(i & 0xff), fd);
- X }
- X
- X static void
- --- 292,301 ----
- X long i;
- X #endif /*__STDC__*/
- X {
- ! (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);
- X }
- X
- X static void
- ***************
- *** 412,418 ****
- X }
- X else
- X {
- ! putc(packcols, fd);
- X oc = packcols + 1;
- X }
- X
- --- 412,418 ----
- X }
- X else
- X {
- ! (void) putc(packcols, fd);
- X oc = packcols + 1;
- X }
- X
- ***************
- *** 420,426 ****
- X while(p != packed)
- X {
- X --p;
- ! putc(*p, fd);
- X }
- X
- X return (oc);
- --- 420,426 ----
- X while(p != packed)
- X {
- X --p;
- ! (void) putc(*p, fd);
- X }
- X
- X return (oc);
- ***************
- *** 450,456 ****
- X }
- X else
- X {
- ! putc(bc, fd);
- X oc = bc + 1;
- X }
- X for (i = 0, pP = rowpixels; i < cols;)
- --- 450,456 ----
- X }
- X else
- X {
- ! (void) putc(bc, fd);
- X oc = bc + 1;
- X }
- X for (i = 0, pP = rowpixels; i < cols;)
- ***************
- *** 457,466 ****
- X {
- X if (cols - i > MAX_COUNT)
- X {
- ! putc(MAX_COUNT - 1, fd);
- X for (j = 0; j < MAX_COUNT; j++)
- X {
- ! putc(ppm_lookupcolor(cht, pP), fd);
- X pP++;
- X }
- X i += MAX_COUNT;
- --- 457,466 ----
- X {
- X if (cols - i > MAX_COUNT)
- X {
- ! (void) putc(MAX_COUNT - 1, fd);
- X for (j = 0; j < MAX_COUNT; j++)
- X {
- ! (void) putc(ppm_lookupcolor(cht, pP), fd);
- X pP++;
- X }
- X i += MAX_COUNT;
- ***************
- *** 467,476 ****
- X }
- X else
- X {
- ! putc(cols - i - 1, fd);
- X for (j = 0; j < cols - i; j++)
- X {
- ! putc(ppm_lookupcolor(cht, pP), fd);
- X pP++;
- X }
- X i = cols;
- --- 467,476 ----
- X }
- X else
- X {
- ! (void) putc(cols - i - 1, fd);
- X for (j = 0; j < cols - i; j++)
- X {
- ! (void) putc(ppm_lookupcolor(cht, pP), fd);
- X pP++;
- X }
- X 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 ----
- X tgaHeader.AttBits = 0;
- X tgaHeader.Rsrvd = 0;
- X tgaHeader.IntrLve = 0;
- + tgaHeader.OrgBit = 0;
- X
- X /* Write out the Targa header. */
- X 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 ****
- X (void) strcpy( out_name, "noname" );
- X /* Remove trailing _icon in name. */
- X cp = rindex( out_name, '_' );
- ! if ( cp[1] == 'i' && cp[2] == 'c' && cp[3] == 'o' && cp[4] == 'n' &&
- ! cp[5] == '\0' )
- X *cp = '\0';
- X }
- X ++argn;
- --- 86,94 ----
- X (void) strcpy( out_name, "noname" );
- X /* Remove trailing _icon in name. */
- X cp = rindex( out_name, '_' );
- ! if ( cp != (char*) 0 &&
- ! cp[1] == 'i' && cp[2] == 'c' && cp[3] == 'o' &&
- ! cp[4] == 'n' && cp[5] == '\0' )
- X *cp = '\0';
- X }
- X ++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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X }
- X ppm_writeppmrow( stdout, pixrow, cols, (pixval) 255, 0 );
- X }
- +
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X pm_close( rfd );
- X pm_close( gfd );
- X pm_close( bfd );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X ppm_writeppmrow( stdout, pixelrow, COLS, (pixval) MAXVAL, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- X
- 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 ----
- X ppm_writeppmrow( stdout, pixelrow, COLS, (pixval) MAXVAL, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- 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 ----
- X pm_close( ifp );
- X
- X ppm_writeppm( stdout, pixels, cols, rows, (pixval) maxval, 0 );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X ppm_writeppmrow( stdout, pixelrow, cols, maxval, 0 );
- X }
- X pm_close( ifp );
- + pm_close( stdout );
- X exit( 0 );
- X }
- X
- 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 ----
- X ppm_writeppmrow( stdout, pixrow, cols, (pixval) PPM_MAXMAXVAL, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- X
- 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 ----
- X ppm_writeppmrow(stdout, pixrow, cols, (pixval) 255, 0);
- X }
- X pm_close(ifp);
- + pm_close(stdout);
- X
- X exit(0);
- X }
- 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 ----
- X
- X pm_close( ifp1 );
- X pm_close( ifp2 );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X
- X for ( i = 0; i < nfiles; ++i )
- X pm_close( ifp[i] );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ****
- X convolution file are only relative.
- X .PP
- X Here is a sample convolution file;
- ! it does a simple average of the immediate neighbors, resulting
- X in a smoothed image:
- X .nf
- X P2
- --- 20,26 ----
- X convolution file are only relative.
- X .PP
- X Here is a sample convolution file;
- ! it does a simple average of the nine immediate neighbors, resulting
- X in a smoothed image:
- X .nf
- X P2
- ***************
- *** 31,42 ****
- X 10 10 10
- X .fi
- X .PP
- ! The convolution file will usually be a bitmap or graymap instead of a pixmap,
- X so that the same convolution gets applied to each color component.
- X However, if you want to use a pixmap and do a different convolution to
- X different colors, you can certainly do that.
- X .SH "SEE ALSO"
- ! pnm(5)
- X .SH AUTHOR
- X Copyright (C) 1989, 1991 by Jef Poskanzer.
- X .\" Permission to use, copy, modify, and distribute this software and its
- --- 31,50 ----
- X 10 10 10
- X .fi
- X .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,
- X so that the same convolution gets applied to each color component.
- X However, if you want to use a pixmap and do a different convolution to
- X different colors, you can certainly do that.
- X .SH "SEE ALSO"
- ! pnmsmooth(1), pnm(5)
- X .SH AUTHOR
- X Copyright (C) 1989, 1991 by Jef Poskanzer.
- X .\" 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 ----
- X pnm_writepnmrow(
- X stdout, xelbuf[(row-crowso2) % crows], cols, maxval, newformat, 0 );
- X
- + pm_close( stdout );
- X exit( 0 );
- X }
- 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 ----
- X pnm_writepnminit( stdout, newcols, newrows, maxval, format, 0 );
- X for ( row = top; row <= bottom; row++ )
- X pnm_writepnmrow( stdout, &(xels[row][left]), newcols, maxval, format, 0 );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ****
- X register xel* xP;
- X int argn, rows, cols, format, newformat, row;
- X register int col;
- ! xelval maxval, newmaxval;
- X int i;
- X char* usage = "newmaxval [pnmfile]";
- X
- --- 24,31 ----
- X register xel* xP;
- X int argn, rows, cols, format, newformat, row;
- X register int col;
- ! xelval maxval;
- ! int newmaxval;
- X int i;
- X char* usage = "newmaxval [pnmfile]";
- X
- ***************
- *** 34,45 ****
- X
- X if ( argn == argc )
- X pm_usage( usage );
- ! if ( sscanf( argv[argn], "%d", &i ) != 1 )
- X pm_usage( usage );
- - newmaxval = i;
- X ++argn;
- X if ( newmaxval < 1 )
- ! pm_error( "newmaxval must be > 1" );
- X
- X if ( argn != argc )
- X {
- --- 35,48 ----
- X
- X if ( argn == argc )
- X pm_usage( usage );
- ! if ( sscanf( argv[argn], "%d", &newmaxval ) != 1 )
- X pm_usage( usage );
- X ++argn;
- X 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" );
- X
- X if ( argn != argc )
- X {
- ***************
- *** 65,71 ****
- X newformat = format;
- X
- X for ( i = 0; i <= maxval; ++i )
- ! newvals[i] = i * newmaxval / maxval;
- X
- X pnm_writepnminit( stdout, cols, rows, newmaxval, newformat, 0 );
- X
- --- 68,74 ----
- X newformat = format;
- X
- X for ( i = 0; i <= maxval; ++i )
- ! newvals[i] = ( i * newmaxval + maxval / 2 ) / maxval;
- X
- X pnm_writepnminit( stdout, cols, rows, newmaxval, newformat, 0 );
- X
- ***************
- *** 92,97 ****
- --- 95,101 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ****
- X goto again;
- X }
- X
- ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); }
- X
- X TRY("pnmarith", pnmarith_main);
- X TRY("pnmcat", pnmcat_main);
- --- 32,38 ----
- X goto again;
- X }
- X
- ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); }
- X
- X TRY("pnmarith", pnmarith_main);
- X 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X
- X pm_close( ifp1 );
- X pm_close( ifp2 );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X pnm_writepnmrow( stdout, newxelrow, newcols, maxval, newformat, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- 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 ----
- X pnm_writepnmrow( stdout, xelrow, width, maxval, format, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- 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 ----
- X pm_message(
- X "If you want an 8-bit palette file, try doing a 'ppmquant %d'.",
- X MAXCOLORS );
- + grayscale = 0;
- X }
- X else
- X {
- ***************
- *** 162,167 ****
- --- 163,169 ----
- X break;
- X
- X default:
- + chv = (colorhist_vector) 0;
- X grayscale = 1;
- X break;
- X }
- 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 ****
- X pm_writebigshort( stdout, color.red );
- X pm_writebigshort( stdout, color.green );
- X pm_writebigshort( stdout, color.blue );
- ! putc( color.flags, stdout );
- ! putc( color.pad, stdout );
- X }
- X }
- X
- --- 255,262 ----
- X pm_writebigshort( stdout, color.red );
- X pm_writebigshort( stdout, color.green );
- X pm_writebigshort( stdout, color.blue );
- ! (void) putc( color.flags, stdout );
- ! (void) putc( color.pad, stdout );
- X }
- X }
- X
- 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 ----
- X pnm_writepnmrow( stdout, xelrow, cols, maxval, format, 0 );
- X }
- X
- + pm_close( stdout );
- +
- X exit( 0 );
- X }
- 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 ----
- X pnm_writepnmrow( stdout, xelrow, cols, (xelval) maxval, format, 0 );
- X }
- X
- + pm_close( stdout );
- X exit( 0 );
- X }
- 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 ----
- X static short bs_short ARGS(( short s ));
- X static long bs_long ARGS(( long l ));
- X
- + 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;
- +
- X void
- X main( argc, argv )
- X int argc;
- ***************
- *** 83,91 ****
- X register unsigned long ul;
- X
- X ul = getpixnum( ifp );
- ! PPM_ASSIGN( *xP, ( ( ul & 0xff0000 ) >> 16 ),
- ! ( ( ul & 0xff00 ) >> 8 ),
- ! ( ul & 0xff ) );
- X }
- X break;
- X
- --- 92,116 ----
- X register unsigned long ul;
- X
- X 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" );
- ! }
- X }
- X break;
- X
- ***************
- *** 98,115 ****
- X }
- X
- X pm_close( ifp );
- X
- X exit( 0 );
- X }
- X
- - 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;
- -
- X static void
- X getinit( file, colsP, rowsP, padrightP, maxvalP, visualclassP, formatP, colorsP )
- X FILE* file;
- --- 123,133 ----
- X }
- X
- X pm_close( ifp );
- + pm_close( stdout );
- X
- X exit( 0 );
- X }
- X
- X static void
- X getinit( file, colsP, rowsP, padrightP, maxvalP, visualclassP, formatP, colorsP )
- X FILE* file;
- ***************
- *** 363,369 ****
- X if ( *visualclassP == TrueColor || *visualclassP == DirectColor )
- X {
- X *formatP = PPM_TYPE;
- ! *maxvalP = 255;
- X }
- X else if ( *visualclassP == StaticGray && h11P->bits_per_pixel == 1 )
- X {
- --- 381,390 ----
- X if ( *visualclassP == TrueColor || *visualclassP == DirectColor )
- X {
- X *formatP = PPM_TYPE;
- ! if ( h11P->bits_per_pixel == 16 )
- ! *maxvalP = 31;
- ! else
- ! *maxvalP = 255;
- X }
- X else if ( *visualclassP == StaticGray && h11P->bits_per_pixel == 1 )
- X {
- ***************
- *** 414,419 ****
- --- 435,443 ----
- X pixel_mask = -1;
- X else
- X pixel_mask = ( 1 << bits_per_pixel ) - 1;
- + red_mask = h11P->red_mask;
- + green_mask = h11P->green_mask;
- + blue_mask = h11P->blue_mask;
- X }
- X else
- X pm_error( "unknown XWD file version: %d", h11P->file_version );
- SHAR_EOF
- echo 'File p121091.diffs is complete' &&
- chmod 0664 p121091.diffs ||
- echo 'restore of p121091.diffs failed'
- Wc_c="`wc -c < 'p121091.diffs'`"
- test 77113 -eq "$Wc_c" ||
- echo 'p121091.diffs: original size 77113, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= pbm/Imakefile ==============
- if test ! -d 'pbm'; then
- echo 'x - creating directory pbm'
- mkdir 'pbm'
- fi
- if test -f 'pbm/Imakefile' -a X"$1" != X"-c"; then
- echo 'x - skipping pbm/Imakefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting pbm/Imakefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'pbm/Imakefile' &&
- /* Imakefile for pbm tools
- X *
- X * Copyright (C) 1991 Rainer Klute
- X *
- X * Permission to use, copy, modify, distribute, and sell this software and
- X * its documentation for any purpose is hereby granted without fee, provided
- X * that the above copyright notice appear in all copies and that both that
- X * copyright notice and this permission notice appear in supporting
- X * documentation, and that the copyright holder's name not be used in
- X * advertising or publicity pertaining to distribution of the software
- X * without specific, written prior permission. The copyright holder makes
- X * no representations about the suitability of this software for any
- X * purpose. It is provided "as is" without express or implied warranty.
- X */
- X
- #define LibPbm libpbm.a
- #define DepLibPbm LibPbm
- #include <../Pbmplus.tmpl>
- X
- X CURRENTLIBS = $(LIBPBM)
- CURRENTDEPLIBS = $(DEPLIBPBM)
- X INCLUDES = -I..
- #if BuildLibTiff
- X DEFINES = -DRGB_DB=\"DefaultRGBDatabase\" -DLIBTIFF
- #else
- X DEFINES = -DRGB_DB=\"DefaultRGBDatabase\"
- #endif
- X MERGE = pbmmerge
- X
- X MAN1 = atktopbm.1 brushtopbm.1 cmuwmtopbm.1 g3topbm.1 \
- X icontopbm.1 gemtopbm.1 macptopbm.1 mgrtopbm.1 \
- X pbmlife.1 pbmmake.1 pbmmask.1 pbmreduce.1 \
- X pbmtext.1 pbmto10x.1 pbmtoascii.1 pbmtoatk.1 \
- X pbmtobbnbg.1 pbmtocmuwm.1 pbmtoepson.1 pbmtog3.1 \
- X pbmtogem.1 pbmtogo.1 pbmtoicon.1 pbmtolj.1 pbmtomacp.1 \
- X pbmtomgr.1 pbmtopi3.1 pbmtoplot.1 pbmtoptx.1 \
- X pbmtox10bm.1 pbmtoxbm.1 pbmtoybm.1 pbmtozinc.1 \
- X pbmupc.1 pi3topbm.1 xbmtopbm.1 ybmtopbm.1
- X MAN3 = libpbm.3
- X MAN5 = pbm.5
- X
- X SRCS = atktopbm.c brushtopbm.c cmuwmtopbm.c g3topbm.c \
- X icontopbm.c gemtopbm.c macptopbm.c mgrtopbm.c \
- X pbmlife.c pbmmake.c pbmmask.c pbmreduce.c \
- X pbmtext.c pbmto10x.c pbmtoascii.c pbmtoatk.c \
- X pbmtobbnbg.c pbmtocmuwm.c pbmtoepson.c pbmtog3.c \
- X pbmtogem.c pbmtogo.c pbmtoicon.c pbmtolj.c pbmtomacp.c \
- X pbmtomgr.c pbmtopi3.c pbmtoplot.c pbmtoptx.c \
- X pbmtox10bm.c pbmtoxbm.c pbmtoybm.c pbmtozinc.c \
- X pbmupc.c pi3topbm.c xbmtopbm.c ybmtopbm.c
- X
- X OBJS = atktopbm.o brushtopbm.o cmuwmtopbm.o g3topbm.o \
- X icontopbm.o gemtopbm.o macptopbm.o mgrtopbm.o \
- X pbmlife.o pbmmake.o pbmmask.o pbmreduce.o \
- X pbmtext.o pbmto10x.o pbmtoascii.o pbmtoatk.o \
- X pbmtobbnbg.o pbmtocmuwm.o pbmtoepson.o pbmtog3.o \
- X pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \
- X pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \
- X pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \
- X pbmupc.o pi3topbm.o xbmtopbm.o ybmtopbm.o
- X
- X BINS = atktopbm brushtopbm cmuwmtopbm g3topbm \
- X icontopbm gemtopbm macptopbm mgrtopbm \
- X pbmlife pbmmake pbmmask pbmreduce \
- X pbmtext pbmto10x pbmtoascii pbmtoatk \
- X pbmtobbnbg pbmtocmuwm pbmtoepson pbmtog3 \
- X pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \
- X pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \
- X pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \
- X pbmupc pi3topbm xbmtopbm ybmtopbm
- X
- AllTarget($(LIBPBM) $(BINS))
- X
- DependTarget()
- X
- NormalPbmplusProgramTarget(atktopbm)
- NormalPbmplusProgramTarget(brushtopbm)
- NormalPbmplusProgramTarget(cmuwmtopbm)
- NormalPbmplusProgramTarget(g3topbm)
- NormalPbmplusProgramTarget(icontopbm)
- NormalPbmplusProgramTarget(gemtopbm)
- NormalPbmplusProgramTarget(macptopbm)
- NormalPbmplusProgramTarget(mgrtopbm)
- NormalPbmplusProgramTarget(pbmlife)
- NormalPbmplusProgramTarget(pbmmake)
- NormalPbmplusProgramTarget(pbmmask)
- NormalPbmplusProgramTarget(pbmreduce)
- NormalPbmplusProgramTarget(pbmtext)
- NormalPbmplusProgramTarget(pbmto10x)
- NormalPbmplusProgramTarget(pbmtoascii)
- NormalPbmplusProgramTarget(pbmtoatk)
- NormalPbmplusProgramTarget(pbmtobbnbg)
- NormalPbmplusProgramTarget(pbmtocmuwm)
- NormalPbmplusProgramTarget(pbmtoepson)
- NormalPbmplusProgramTarget(pbmtog3)
- NormalPbmplusProgramTarget(pbmtogem)
- NormalPbmplusProgramTarget(pbmtogo)
- NormalPbmplusProgramTarget(pbmtoicon)
- NormalPbmplusProgramTarget(pbmtolj)
- NormalPbmplusProgramTarget(pbmtomacp)
- NormalPbmplusProgramTarget(pbmtomgr)
- NormalPbmplusProgramTarget(pbmtopi3)
- NormalPbmplusProgramTarget(pbmtoplot)
- NormalPbmplusProgramTarget(pbmtoptx)
- NormalPbmplusProgramTarget(pbmtox10bm)
- NormalPbmplusProgramTarget(pbmtoxbm)
- NormalPbmplusProgramTarget(pbmtoybm)
- NormalPbmplusProgramTarget(pbmtozinc)
- NormalPbmplusProgramTarget(pbmupc)
- NormalPbmplusProgramTarget(pi3topbm)
- NormalPbmplusProgramTarget(xbmtopbm)
- NormalPbmplusProgramTarget(ybmtopbm)
- X
- NormalLibraryObjectRule()
- NormalLibraryTarget(pbm,libpbm1.o libpbm2.o libpbm3.o libpbm4.o libpbm5.o)
- X
- #if InstallMerged
- NormalProgramTarget($(MERGE),$(MERGE).o $(OBJS),$(CURRENTDEPLIBS),$(CURRENTLIBS),-lm)
- #if InstallBinaries
- InstallProgram($(MERGE),$(PBMPLUSDIR)$(PBMPLUSBINDIR))
- #endif
- #endif
- X
- #if InstallBinaries
- InstallPbmplusPrograms($(BINS),$(PBMPLUSDIR)$(PBMPLUSBINDIR),$(INSTPGMFLAGS))
- #endif
- X
- #if InstallManuals
- InstallMultipleMan($(MAN1),$(PBMPLUSDIR)$(PBMPLUSMANDIR)/man1)
- InstallMultipleMan($(MAN3),$(PBMPLUSDIR)$(PBMPLUSMANDIR)/man3)
- InstallMultipleMan($(MAN5),$(PBMPLUSDIR)$(PBMPLUSMANDIR)/man5)
- #endif
- X
- #if InstallLibraries
- InstallLibrary(pbm,$(PBMPLUSDIR)$(PBMPLUSLIBDIR))
- #endif
- X
- #if InstallIncludes
- InstallMultipleFlags(pbm.h,$(PBMPLUSDIR)$(PBMPLUSINCDIR),$(INSTINCFLAGS))
- #endif
- SHAR_EOF
- chmod 0664 pbm/Imakefile ||
- echo 'restore of pbm/Imakefile failed'
- Wc_c="`wc -c < 'pbm/Imakefile'`"
- test 5156 -eq "$Wc_c" ||
- echo 'pbm/Imakefile: original size 5156, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= pgm/Imakefile ==============
- if test ! -d 'pgm'; then
- echo 'x - creating directory pgm'
- mkdir 'pgm'
- fi
- if test -f 'pgm/Imakefile' -a X"$1" != X"-c"; then
- echo 'x - skipping pgm/Imakefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting pgm/Imakefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'pgm/Imakefile' &&
- /* Imakefile for pgm tools
- X *
- X * Copyright (C) 1991 Rainer Klute
- X *
- X * Permission to use, copy, modify, distribute, and sell this software and
- X * its documentation for any purpose is hereby granted without fee, provided
- X * that the above copyright notice appear in all copies and that both that
- X * copyright notice and this permission notice appear in supporting
- X * documentation, and that the copyright holder's name not be used in
- X * advertising or publicity pertaining to distribution of the software
- X * without specific, written prior permission. The copyright holder makes
- X * no representations about the suitability of this software for any
- X * purpose. It is provided "as is" without express or implied warranty.
- X */
- X
- #define LibPgm libpgm.a
- #define DepLibPgm LibPgm
- #include <../Pbmplus.tmpl>
- X
- X CURRENTLIBS = $(LIBPGM) $(LIBPBM)
- CURRENTDEPLIBS = $(DEPLIBPGM) $(DEPLIBPBM)
- X INCLUDES = -I.. -I$(PBMDIR)
- X MERGE = pgmmerge
- X
- X MAN1 = fitstopgm.1 fstopgm.1 hipstopgm.1 lispmtopgm.1 pgmbentley.1 \
- X pgmenhance.1 pgmhist.1 pgmnorm.1 pgmoil.1 pgmramp.1 \
- X pgmtofits.1 pgmtofs.1 pgmtolispm.1 pgmtopbm.1 \
- X psidtopgm.1 rawtopgm.1 \
- X pgmcrater.1 pgmedge.1 pgmtexture.1
- X MAN3 = libpgm.3
- X MAN5 = pgm.5
- X
- X SRCS = fitstopgm.c fstopgm.c hipstopgm.c lispmtopgm.c pgmbentley.c \
- X pgmenhance.c pgmhist.c pgmnorm.c pgmoil.c pgmramp.c \
- X pgmtofits.c pgmtofs.c pgmtolispm.c pgmtopbm.c \
- X psidtopgm.c rawtopgm.c \
- X pgmcrater.c pgmedge.c pgmtexture.c
- X
- X OBJS = fitstopgm.o fstopgm.o hipstopgm.o lispmtopgm.o pgmbentley.o \
- X pgmenhance.o pgmhist.o pgmnorm.o pgmoil.o pgmramp.o \
- X pgmtofits.o pgmtofs.o pgmtolispm.o pgmtopbm.o \
- X psidtopgm.o rawtopgm.o \
- X pgmcrater.o pgmedge.o pgmtexture.o
- X
- X BINS = fitstopgm fstopgm hipstopgm lispmtopgm pgmbentley \
- X pgmenhance pgmhist pgmnorm pgmoil pgmramp \
- X pgmtofits pgmtofs pgmtolispm pgmtopbm \
- X psidtopgm rawtopgm \
- X pgmcrater pgmedge pgmtexture
- X
- AllTarget($(LIBPGM) $(BINS))
- X
- DependTarget()
- X
- NormalPbmplusProgramTarget(fitstopgm)
- NormalPbmplusProgramTarget(fstopgm)
- NormalPbmplusProgramTarget(hipstopgm)
- NormalPbmplusProgramTarget(lispmtopgm)
- NormalPbmplusProgramTarget(pgmbentley)
- NormalPbmplusProgramTarget(pgmenhance)
- NormalPbmplusProgramTarget(pgmhist)
- NormalPbmplusProgramTarget(pgmnorm)
- NormalPbmplusProgramTarget(pgmoil)
- NormalPbmplusProgramTarget(pgmramp)
- NormalPbmplusProgramTarget(pgmtofits)
- NormalPbmplusProgramTarget(pgmtofs)
- NormalPbmplusProgramTarget(pgmtolispm)
- NormalPbmplusProgramTarget(pgmtopbm)
- NormalPbmplusProgramTarget(psidtopgm)
- NormalPbmplusProgramTarget(rawtopgm)
- NormalPbmplusMathProgramTarget(pgmcrater)
- NormalPbmplusMathProgramTarget(pgmedge)
- NormalPbmplusMathProgramTarget(pgmtexture)
- X
- NormalLibraryObjectRule()
- NormalLibraryTarget(pgm,libpgm1.o libpgm2.o)
- X
- #if InstallMerged
- NormalProgramTarget($(MERGE),$(MERGE).o $(OBJS),$(CURRENTDEPLIBS),$(CURRENTLIBS),-lm)
- #if InstallBinaries
- InstallProgram($(MERGE),$(PBMPLUSDIR)$(PBMPLUSBINDIR))
- #endif
- #endif
- X
- #if InstallBinaries
- InstallPbmplusPrograms($(BINS),$(PBMPLUSDIR)$(PBMPLUSBINDIR),$(INSTPGMFLAGS))
- #endif
- X
- #if InstallManuals
- InstallMultipleMan($(MAN1),$(PBMPLUSDIR)$(PBMPLUSMANDIR)/man1)
- InstallMultipleMan($(MAN3),$(PBMPLUSDIR)$(PBMPLUSMANDIR)/man3)
- InstallMultipleMan($(MAN5),$(PBMPLUSDIR)$(PBMPLUSMANDIR)/man5)
- #endif
- X
- #if InstallLibraries
- InstallLibrary(pgm,$(PBMPLUSDIR)$(PBMPLUSLIBDIR))
- #endif
- X
- #if InstallIncludes
- InstallMultipleFlags(pgm.h,$(PBMPLUSDIR)$(PBMPLUSINCDIR),$(INSTINCFLAGS))
- #endif
- SHAR_EOF
- chmod 0664 pgm/Imakefile ||
- echo 'restore of pgm/Imakefile failed'
- Wc_c="`wc -c < 'pgm/Imakefile'`"
- test 3534 -eq "$Wc_c" ||
- echo 'pgm/Imakefile: original size 3534, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= pgm/pgmcrater.1 ==============
- if test -f 'pgm/pgmcrater.1' -a X"$1" != X"-c"; then
- echo 'x - skipping pgm/pgmcrater.1 (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting pgm/pgmcrater.1 (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'pgm/pgmcrater.1' &&
- .TH pgmcrater 1 "15 October 1991"
- .IX pgmcrater
- .IX fractals
- .IX craters
- .SH NAME
- pgmcrater - create cratered terrain by fractal forgery
- .SH SYNOPSIS
- .na
- .B pgmcrater
- 'ti 15
- .RB [ -number
- .IR n ]
- .RB [ -height | -ysize
- .IR s ]
- .RB [ -width | -xsize
- .IR s ]
- .RB [ -gamma
- .IR g ]
- .ad
- .SH DESCRIPTION
- .B pgmcrater
- creates a portable graymap which mimics cratered terrain. The graymap
- is created by simulating the impact of a given number of craters with
- random position and size, then rendering the resulting terrain
- elevations based on a light source shining from one side of the
- screen. The size distribution of the craters is based on a power law
- which results in many more small craters than large ones. The number
- of craters of a given size varies as the reciprocal of the area as
- described on pages 31 and 32 of Peitgen and Saupe[1]; cratered bodies
- in the Solar System are observed to obey this relationship. The
- formula used to obtain crater radii governed by this law from a
- uniformly distributed pseudorandom sequence was developed by Rudy
- Rucker.
- .PP
- High resolution images with large numbers of craters often benefit
- from being piped through
- .BR pnmsmooth .
- The averaging performed by this process eliminates some of the jagged
- pixels and lends a mellow ``telescopic image'' feel to the overall
- picture.
- .SH OPTIONS
- .TP 10
- .BI -number " n"
- Causes
- .I n
- craters to be generated. If no
- .B -number
- specification is given, 50000 craters will be generated. Don't expect
- to see them all! For every large crater there are many, many more
- tiny ones which tend simply to erode the landscape. In general, the
- more craters you specify the more realistic the result; ideally you
- want the entire terrain to have been extensively turned over again and
- again by cratering. High resolution images containing five to ten
- million craters are stunning but take quite a while to create.
- .TP
- .BI -height " height"
- Sets the height of the generated image to
- .I height
- pixels. The default height is 256 pixels.
- .TP
- .BI -width " width"
- Sets the width of the generated image to
- .I width
- pixels. The default width is 256 pixels.
- .TP
- .BI -xsize " width"
- Sets the width of the generated image to
- .I width
- pixels. The default width is 256 pixels.
- .TP
- .BI -ysize " height"
- Sets the height of the generated image to
- .I height
- pixels. The default height is 256 pixels.
- .TP
- .BI -gamma " factor"
- The specified
- .I factor
- is used to gamma correct the graymap in the same manner as performed
- by
- .BR pnmgamma .
- The default value is 1.0, which results in a medium contrast image.
- Values larger than 1 lighten the image and reduce contrast, while
- values less than 1 darken the image, increasing contrast.
- .PP
- All flags can be abbreviated to their shortest unique prefix.
- .SH BUGS
- The
- .B -gamma
- option isn't really necessary since you can achieve the same
- effect by piping the output from
- .B pgmcrater
- through
- .BR pnmgamma .
- However,
- .B pgmcrater
- performs an internal gamma map anyway in the process of rendering the
- elevation array into a graymap, so there's no additional overhead in
- allowing a user-specified gamma.
- .PP
- Real craters have two distinct morphologies.
- .B pgmcrater
- simulates only small craters, which are hemispherical in shape
- (regardless of the incidence angle of the impacting body, as long as the
- velocity is sufficiently high). Large craters, such as Copernicus and
- Tycho on the Moon, have a ``walled plain'' shape with a cross-section more
- like:
- .nf
- .ne 2
- .cs R 18
- X /\\ /\\
- .br
- X _____/ \\____________/\\____________/ \\_____
- .cs R
- .fi
- .ss 12
- Larger craters should really use this profile, including the central
- peak, and totally obliterate the pre-existing terrain.
- .SH "SEE ALSO"
- .PD
- .BR pgm (5),
- .BR pnmgamma (1),
- .BR pnmsmooth (1)
- .TP 5
- [1]
- Peitgen, H.-O., and Saupe, D. eds., The Science Of Fractal Images,
- New York: Springer Verlag, 1988.
- .ne 10
- .SH AUTHOR
- .RS 5
- .nf
- John Walker
- Autodesk SA
- Avenue des Champs-Montants 14b
- CH-2074 MARIN
- Suisse/Schweiz/Svizzera/Svizra/Switzerland
- .PD 0
- .TP 9
- Usenet:
- kelvin@Autodesk.com
- .TP
- Fax:
- 038/33 88 15
- .TP
- Voice:
- 038/33 76 33
- .fi
- .RE
- .PD
- .PP
- Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted,
- without any conditions or restrictions. This software is provided ``as
- is'' without express or implied warranty.
- .PP
- .B PLUGWARE!
- If you like this kind of stuff, you may also enjoy ``James Gleick's
- Chaos--The Software'' for MS-DOS, available for $59.95 from your
- local software store or directly from Autodesk, Inc., Attn: Science
- Series, 2320 Marinship Way, Sausalito, CA 94965, USA. Telephone:
- (800) 688-2344 toll-free or, outside the U.S. (415) 332-2344 Ext
- 4886. Fax: (415) 289-4718. ``Chaos--The Software'' includes a more
- comprehensive fractal forgery generator which creates
- three-dimensional landscapes as well as clouds and planets, plus five
- more modules which explore other aspects of Chaos. The user guide of
- more than 200 pages includes an introduction by James Gleick and
- detailed explanations by Rudy Rucker of the mathematics and algorithms
- used by each program.
- SHAR_EOF
- chmod 0664 pgm/pgmcrater.1 ||
- echo 'restore of pgm/pgmcrater.1 failed'
- Wc_c="`wc -c < 'pgm/pgmcrater.1'`"
- test 5160 -eq "$Wc_c" ||
- echo 'pgm/pgmcrater.1: original size 5160, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= pgm/pgmcrater.c ==============
- if test -f 'pgm/pgmcrater.c' -a X"$1" != X"-c"; then
- echo 'x - skipping pgm/pgmcrater.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting pgm/pgmcrater.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'pgm/pgmcrater.c' &&
- /*
- X
- X Fractal cratering
- X
- X Designed and implemented in November of 1989 by:
- X
- X John Walker
- X Autodesk SA
- X Avenue des Champs-Montants 14b
- X CH-2074 MARIN
- X Switzerland
- X Usenet: kelvin@Autodesk.com
- X Fax: 038/33 88 15
- X Voice: 038/33 76 33
- X
- X The algorithm used to determine crater size is as described on
- SHAR_EOF
- true || echo 'restore of pgm/pgmcrater.c failed'
- fi
- echo 'End of part 2'
- echo 'File pgm/pgmcrater.c is continued in part 3'
- echo 3 > _shar_seq_.tmp
- exit 0
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-