fix conflicts

This commit is contained in:
brad 1999-03-19 01:57:41 +00:00
parent 4b63af8b5c
commit 6a5228bb5b
6 changed files with 387 additions and 266 deletions

View File

@ -1,86 +1,27 @@
# New ports collection makefile for: netpbm
# Version required: netpbm-94.3.1
# Date created: 14 May 1998
# Whom: Oleg Safiullin <form@OpenBSD.ORG>
#
# $OpenBSD: Makefile,v 1.3 1998/10/20 08:39:46 form Exp $
# NetBSD: Makefile,v 1.14 1998/04/22 14:22:43 agc Exp
#
# $OpenBSD: Makefile,v 1.4 1999/03/19 01:57:41 brad Exp $
# $NetBSD: Makefile,v 1.25 1999/03/04 14:18:54 tron Exp $
DISTNAME= netpbm
PKGNAME= netpbm-94.3.1
DISTNAME= netpbm-1mar1994
PKGNAME= netpbm-19940301
CATEGORIES= graphics
MASTER_SITES= ftp://ftp.wustl.edu//graphics/graphics/packages/NetPBM/ \
ftp://ftp.informatik.uni-oldenburg.de/pub/netpbm/ \
ftp://ftp.informatik.uni-oldenburg.de/pub/grafik/png/applications/
DISTFILES= netpbm-1mar1994.tar.gz \
pcxtoppm.tar.gz \
rletopnm.tar.gz \
pnmtopng-2.36.tar.gz
MASTER_SITES= ftp://ftp.wustl.edu/graphics/graphics/packages/NetPBM/ \
ftp://ftp.informatik.uni-oldenburg.de/pub/netpbm/
MAINTAINER= form@OpenBSD.ORG
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} pcxtoppm.tar.gz rletopnm.tar.gz pnmtopng-2.37.1.tar.gz
LIB_DEPENDS= jpeg\\.62\\.:${PORTSDIR}/graphics/jpeg \
tiff\\.3\\.4:${PORTSDIR}/graphics/tiff34 \
png\\.1\\.:${PORTSDIR}/graphics/png
MAINTAINER= brad@openbsd.org
LIB_DEPENDS= tiff:${PORTSDIR}/graphics/tiff34 \
jpeg:${PORTSDIR}/graphics/jpeg \
png:${PORTSDIR}/graphics/png
WRKSRC= ${WRKDIR}/netpbm
MAKE_ENV += PREFIX=${PREFIX} INSTALL_MAN="${INSTALL_MAN}"
MAN1= atktopbm.1 g3topbm.1 brushtopbm.1 cmuwmtopbm.1 \
icontopbm.1 gemtopbm.1 macptopbm.1 mgrtopbm.1 \
pbmclean.1 pbmlife.1 pbmmake.1 pbmmask.1 \
pbmpscale.1 pbmreduce.1 pbmtext.1 pbmto10x.1 \
pbmto4425.1 pbmtoascii.1 pbmtoatk.1 pbmtobbnbg.1 \
pbmtocmuwm.1 pbmtoepsi.1 pbmtoepson.1 pbmtog3.1 \
pbmtogem.1 pbmtogo.1 pbmtoicon.1 pbmtolj.1 \
pbmtoln03.1 pbmtolps.1 pbmtomacp.1 pbmtomgr.1 \
pbmtopi3.1 pbmtopk.1 pbmtoplot.1 pbmtoptx.1 \
pbmtox10bm.1 pbmtoxbm.1 pbmtoybm.1 pbmtozinc.1 \
pbmupc.1 pi3topbm.1 pktopbm.1 xbmtopbm.1 \
ybmtopbm.1 asciitopgm.1 bioradtopgm.1 fstopgm.1 \
hipstopgm.1 lispmtopgm.1 pbmtopgm.1 pgmbentley.1 \
pgmenhance.1 pgmhist.1 pgmkernel.1 pgmnoise.1 \
pgmnorm.1 pgmoil.1 pgmramp.1 pgmtofs.1 \
pgmtolispm.1 pgmtopbm.1 psidtopgm.1 rawtopgm.1 \
spottopgm.1 pgmcrater.1 pgmedge.1 pgmtexture.1 \
bmptoppm.1 gouldtoppm.1 hpcdtoppm.1 ilbmtoppm.1 \
imgtoppm.1 mtvtoppm.1 pcxtoppm.1 pgmtoppm.1 \
pi1toppm.1 picttoppm.1 pjtoppm.1 ppm3d.1 \
ppmbrighten.1 ppmchange.1 ppmdim.1 ppmdist.1 \
ppmdither.1 ppmflash.1 ppmhist.1 ppmmake.1 \
ppmmix.1 ppmnorm.1 ppmntsc.1 ppmquant.1 \
ppmrelief.1 ppmshift.1 ppmspread.1 ppmtoacad.1 \
ppmtobmp.1 ppmtogif.1 ppmtoicr.1 ppmtoilbm.1 \
ppmtomitsu.1 ppmtopcx.1 ppmtopgm.1 ppmtopi1.1 \
ppmtopict.1 ppmtopj.1 ppmtopjxl.1 ppmtopuzz.1 \
ppmtorgb3.1 ppmtosixel.1 ppmtotga.1 ppmtouil.1 \
ppmtoxpm.1 ppmtoyuv.1 ppmtoyuvsplit.1 qrttoppm.1 \
rawtoppm.1 rgb3toppm.1 sldtoppm.1 spctoppm.1 \
sputoppm.1 tgatoppm.1 ximtoppm.1 xpmtoppm.1 \
xvminitoppm.1 yuvtoppm.1 yuvsplittoppm.1 \
ppmforge.1 ppmpat.1 ppmqvga.1 ppmtomap.1 \
ppmquantall.1 fitstopnm.1 giftopnm.1 pnmalias.1 \
pnmarith.1 pnmcat.1 pnmcomp.1 pnmconvol.1 \
pnmcrop.1 pnmcut.1 pnmdepth.1 pnmenlarge.1 \
pnmfile.1 pnmflip.1 pnmhistmap.1 pnminvert.1 \
pnmnlfilt.1 pnmnoraw.1 pnmpad.1 pnmpaste.1 \
pnmscale.1 pnmtile.1 pngtopnm.1 pnmtoddif.1 \
pnmtofits.1 pnmtopng.1 pnmtops.1 pnmtorast.1 \
pnmtorle.1 pnmtosgi.1 pnmtosir.1 pnmtoxwd.1 \
rasttopnm.1 rletopnm.1 sgitopnm.1 sirtopnm.1 \
xwdtopnm.1 zeisstopnm.1 pnmgamma.1 pnmrotate.1 \
pnmshear.1 anytopnm.1 pnmindex.1 pnmmargin.1 \
pnmsmooth.1 tifftopnm.1 pnmtotiff.1 pstopnm.1
MAN3= libpbm.3 libpgm.3 libppm.3 libpnm.3
MAN5= pbm.5 pgm.5 ppm.5 pnm.5
MAKE_ENV += PREFIX=${PREFIX} MANCP="${INSTALL_MAN}"
NO_CONFIGURE= yes
post-extract:
# make sure our TIFF library is used
${MV} -f ${WRKSRC}/libtiff ${WRKSRC}/libtiff.notused
# move updates into source tree
cd ${WRKSRC};\
${MV} ../*pcx*.? ppm;\
${MV} ../*rle*.? ../*png*.? pnm
cd ${WRKSRC}; \
${MV} ../*pcx*.? ppm; \
${MV} ../*rle*.? ../*png*.? pnm;
.include <bsd.port.mk>

View File

@ -1,12 +1,12 @@
MD5 (netpbm-1mar1994.tar.gz) = 55f505b09e69a5db8f08844435282dfb
MD5 (pcxtoppm.tar.gz) = d9a37913ef2c2cd412b0e7f969487dc2
MD5 (pnmtopng-2.36.tar.gz) = 37258ecb340f58784faef72f280b1b9f
MD5 (pnmtopng-2.37.1.tar.gz) = 3addb1d14811c86169c4bb09ee8942d7
MD5 (rletopnm.tar.gz) = c0488f9918f506bf6a8d09870d5d115f
RMD160 (netpbm-1mar1994.tar.gz) = 3f951f70ee8d2bf4a643f227239cce52e9f555a2
RMD160 (pcxtoppm.tar.gz) = bf4f63c13bc2258463ac26ec9206cf9e229b3825
RMD160 (pnmtopng-2.36.tar.gz) = 833b9d087d0499d5a129d26ac0933b1190b6acd3
RMD160 (pnmtopng-2.37.1.tar.gz) = ed28319649186d809239f4be437038148a80db1c
RMD160 (rletopnm.tar.gz) = ca75bdd3d1e39a4e019faf4d8f9e1457d47ed328
SHA1 (netpbm-1mar1994.tar.gz) = 056a323d879152d7a5d1fe62f1db59e3ea49670a
SHA1 (pcxtoppm.tar.gz) = 7eb3ab3aaef885f3160855de82f46c7014818375
SHA1 (pnmtopng-2.36.tar.gz) = abaabe8a76c951d8d807ba21d726ef66518adb6d
SHA1 (pnmtopng-2.37.1.tar.gz) = c2ff776cc4b48464e34ccd7fc2304a8aafb1c2d1
SHA1 (rletopnm.tar.gz) = f235402bda29828ce001664014008b39342c2e59

View File

@ -1,109 +1,118 @@
*** Makefile.orig Wed Jan 26 18:47:35 1994
--- Makefile Thu May 14 12:22:10 1998
***************
*** 48,78 ****
# 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
TIFFBINARIES = tifftopnm pnmtotiff
TIFFOBJECTS = tifftopnm.o pnmtotiff.o
# CONFIGURE: Define the directory that you want the binaries copied to.
# If you need scripts and binaries to be in different directories, you
# can set that up too.
! INSTALLBINARIES = /usr/local/netpbm
INSTALLSCRIPTS = $(INSTALLBINARIES)
# CONFIGURE: Define the directories that you want the manual sources copied to,
# plus the suffix you want them to have.
! INSTALLMANUALS1 = /usr/local/man/man1
SUFFIXMANUALS1 = 1
! INSTALLMANUALS3 = /usr/local/man/man3
SUFFIXMANUALS3 = 3
! INSTALLMANUALS5 = /usr/local/man/man5
SUFFIXMANUALS5 = 5
# CONFIGURE: Normally the man pages are installed using "cp". By changing
# this define you can use something else, for example a script that calls
# compress or pack. The ../mantocat is used on systems which use man pages
# in the "cat" format.
! MANCP = cp
#MANCP = ../mantocat
# CONFIGURE: Normally the Makefiles build and install separate binaries for
--- 48,78 ----
# By the way, you must have at least version 2.4 of libtiff. Earlier
# versions will not work.
TIFFDEF = -DLIBTIFF
! TIFFINC = -I$(PREFIX)/include
! TIFFLIB = -L$(PREFIX)/lib -ltiff -ljpeg
TIFFBINARIES = tifftopnm pnmtotiff
TIFFOBJECTS = tifftopnm.o pnmtotiff.o
# CONFIGURE: Define the directory that you want the binaries copied to.
# If you need scripts and binaries to be in different directories, you
# can set that up too.
! INSTALLBINARIES = $(PREFIX)/bin
INSTALLSCRIPTS = $(INSTALLBINARIES)
# CONFIGURE: Define the directories that you want the manual sources copied to,
# plus the suffix you want them to have.
! INSTALLMANUALS1 = $(PREFIX)/man/man1
SUFFIXMANUALS1 = 1
! INSTALLMANUALS3 = $(PREFIX)/man/man3
SUFFIXMANUALS3 = 3
! INSTALLMANUALS5 = $(PREFIX)/man/man5
SUFFIXMANUALS5 = 5
# CONFIGURE: Normally the man pages are installed using "cp". By changing
# this define you can use something else, for example a script that calls
# compress or pack. The ../mantocat is used on systems which use man pages
# in the "cat" format.
! MANCP = ${INSTALL_MAN}
#MANCP = ../mantocat
# CONFIGURE: Normally the Makefiles build and install separate binaries for
***************
*** 87,96 ****
#
# Note that if you make a "merge", the executables don't get created
# until you do the install.
! #all: binaries
! #install: install.bin install.man
! all: merge
! install: install.merge install.man
# End of configurable definitions.
--- 87,96 ----
#
# Note that if you make a "merge", the executables don't get created
# until you do the install.
! all: binaries
! install: install.bin install.man
! #all: merge
! #install: install.merge install.man
# End of configurable definitions.
***************
*** 99,106 ****
SUBDIRS = pbm pgm ppm pnm
binaries:
! ./stamp-date
! ( echo "libtiff" ; cd libtiff ; make )
for i in $(SUBDIRS) ; do \
( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries ); \
done
--- 99,106 ----
SUBDIRS = pbm pgm ppm pnm
binaries:
! # ./stamp-date
! # ( echo "libtiff" ; cd libtiff ; make )
for i in $(SUBDIRS) ; do \
( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries ); \
done
--- Makefile.orig Wed Jan 26 12:47:35 1994
+++ Makefile Mon Jan 11 00:17:07 1999
@@ -21,7 +21,7 @@
#CC = gcc -ansi -pedantic -fcombine-regs -fpcc-struct-return
# CONFIGURE: cc flags go here.
-CFLAGS = -O
+CFLAGS = -O2
#CFLAGS = -g
#CFLAGS = -g -O
@@ -48,33 +48,36 @@
# 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
+TIFFINC = -I$(PREFIX)/include
+TIFFLIB = -L$(PREFIX)/lib -ltiff -ljpeg
TIFFBINARIES = tifftopnm pnmtotiff
TIFFOBJECTS = tifftopnm.o pnmtotiff.o
# CONFIGURE: Define the directory that you want the binaries copied to.
# If you need scripts and binaries to be in different directories, you
# can set that up too.
-INSTALLBINARIES = /usr/local/netpbm
+INSTALLBINARIES = $(PREFIX)/bin
INSTALLSCRIPTS = $(INSTALLBINARIES)
# CONFIGURE: Define the directories that you want the manual sources copied to,
# plus the suffix you want them to have.
-INSTALLMANUALS1 = /usr/local/man/man1
+INSTALLMANUALS1 = $(PREFIX)/man/man1
SUFFIXMANUALS1 = 1
-INSTALLMANUALS3 = /usr/local/man/man3
+INSTALLMANUALS3 = $(PREFIX)/man/man3
SUFFIXMANUALS3 = 3
-INSTALLMANUALS5 = /usr/local/man/man5
+INSTALLMANUALS5 = $(PREFIX)/man/man5
SUFFIXMANUALS5 = 5
# CONFIGURE: Normally the man pages are installed using "cp". By changing
# this define you can use something else, for example a script that calls
# compress or pack. The ../mantocat is used on systems which use man pages
# in the "cat" format.
-MANCP = cp
+MANCP = install -c -m 0644
#MANCP = ../mantocat
+INSTALLLIBS = $(PREFIX)/lib
+INSTALLDEFS = $(PREFIX)/include
+
# CONFIGURE: Normally the Makefiles build and install separate binaries for
# each program. However, on some systems (especially those without shared
# libraries) this can mean a lot of space. In this case you might try
@@ -87,10 +90,10 @@
#
# Note that if you make a "merge", the executables don't get created
# until you do the install.
-#all: binaries
-#install: install.bin install.man
-all: merge
-install: install.merge install.man
+all: binaries
+install: install.bin install.man
+#all: merge
+#install: install.merge install.man
# End of configurable definitions.
@@ -99,10 +102,10 @@
SUBDIRS = pbm pgm ppm pnm
binaries:
- ./stamp-date
- ( echo "libtiff" ; cd libtiff ; make )
+# ./stamp-date
+# ( echo "libtiff" ; cd libtiff ; make )
for i in $(SUBDIRS) ; do \
- ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries ); \
+ ( echo "===> $$i" ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries ); \
done
merge:
@@ -113,15 +116,19 @@
done
install.bin:
- -mkdir $(INSTALLBINARIES)
+# -mkdir $(INSTALLBINARIES)
+# -mkdir $(INSTALLLIBS)
+# -mkdir $(INSTALLDEFS)
for i in $(SUBDIRS) ; do \
- ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLSCRIPTS=$(INSTALLSCRIPTS)' install.bin ); \
+ ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLSCRIPTS=$(INSTALLSCRIPTS)' 'INSTALLLIBS=$(INSTALLLIBS)' 'INSTALLDEFS=$(INSTALLDEFS)' install.bin ); \
done
install.merge:
- -mkdir $(INSTALLBINARIES)
+# -mkdir $(INSTALLBINARIES)
+# -mkdir $(INSTALLLIBS)
+# -mkdir $(INSTALLDEFS)
for i in $(SUBDIRS) ; do \
- ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLSCRIPTS=$(INSTALLSCRIPTS)' install.merge ); \
+ ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLSCRIPTS=$(INSTALLSCRIPTS)' 'INSTALLLIBS=$(INSTALLLIBS)' 'INSTALLDEFS=$(INSTALLDEFS)' install.merge ); \
done
install.man:
@@ -131,7 +138,7 @@
clean:
rm -f *.shar *.shar? art.* *~
- echo "" > compile.h
- for i in $(SUBDIRS) libtiff ; do \
+ rm -f compile.h ; echo "" > compile.h
+ for i in $(SUBDIRS) ; do \
( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) clean ); \
done

View File

@ -1,19 +1,137 @@
*** pbm/pbmtext.c.orig Sat May 30 18:53:47 1998
--- pbm/pbmtext.c Sat May 30 18:54:16 1998
***************
*** 105,111 ****
else
{ /* Read text from stdin. */
lines = 0;
! while ( gets( buf ) != NULL )
{
int l;
--- 105,111 ----
else
{ /* Read text from stdin. */
lines = 0;
! while ( fgets( buf, 4999, stdin ) != NULL )
{
int l;
--- pbm/pbmto10x.c.orig Mon Oct 4 10:10:42 1993
+++ pbm/pbmto10x.c Sun Jan 10 23:48:40 1999
@@ -1,6 +1,6 @@
/* pbmto10x.c - read a portable bitmap and produce a Gemini 10X printer file
**
-** Copyright (C) 1990 by Ken Yap
+** Copyright (C) 1990, 1994 by Ken Yap
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
@@ -8,6 +8,8 @@
** copyright notice and this permission notice appear in supporting
** documentation. This software is provided "as is" without express or
** implied warranty.
+**
+** Modified to shorten stripes and eliminate blank stripes. Dec 1994.
*/
#include "pbm.h"
@@ -52,15 +54,40 @@
}
static void
+outstripe(stripe, sP, reschar)
+ register char *stripe, *sP;
+ register int reschar;
+{
+ register int ncols;
+
+ /* scan backwards, removing empty columns */
+ while (sP != stripe)
+ if (*--sP != 0)
+ {
+ ++sP;
+ break;
+ }
+ ncols = sP - stripe;
+ if (ncols > 0)
+ {
+ printf("\033%c%c%c", reschar, ncols % 256, ncols / 256);
+ fwrite(stripe, sizeof(char), ncols, stdout);
+ }
+ putchar('\n'); /* flush buffer */
+}
+
+static void
res_60x72()
{
register int i, item, npins, row, col;
bit *bitrows[LOW_RES_ROWS], *bP[LOW_RES_ROWS];
+ char *stripe, *sP;
+ stripe = malloc(cols);
for (i = 0; i < LOW_RES_ROWS; ++i)
bitrows[i] = pbm_allocrow(cols);
printf("\033A\010"); /* '\n' = 8/72 */
- for (row = 0; row < rows; row += LOW_RES_ROWS)
+ for (row = 0, sP = stripe; row < rows; row += LOW_RES_ROWS, sP = stripe)
{
if (row + LOW_RES_ROWS <= rows)
npins = LOW_RES_ROWS;
@@ -68,17 +95,18 @@
npins = rows - row;
for (i = 0; i < npins; ++i)
pbm_readpbmrow(ifp, bP[i] = bitrows[i], cols, format);
- printf("\033K%c%c", cols % 256, cols / 256);
for (col = 0; col < cols; ++col)
{
item = 0;
for (i = 0; i < npins; ++i)
if (*(bP[i]++) == PBM_BLACK)
item |= 1 << (7 - i);
- putchar(item);
+ *sP++ = item;
}
- putchar('\n');
+ outstripe(stripe, sP, 'K');
}
+ printf("\033@");
+ free(stripe);
}
static void
@@ -86,11 +114,13 @@
{
register int i, pin, item, npins, row, col;
bit *bitrows[HIGH_RES_ROWS], *bP[HIGH_RES_ROWS];
+ char *stripe, *sP;
+ stripe = malloc(cols);
for (i = 0; i < HIGH_RES_ROWS; ++i)
bitrows[i] = pbm_allocrow(cols);
- putchar('\033'); putchar('3'); putchar('\0');
- for (row = 0; row < rows; row += HIGH_RES_ROWS)
+ printf("\0333\001"); /* \n = 1/144" */
+ for (row = 0, sP = stripe; row < rows; row += HIGH_RES_ROWS, sP = stripe)
{
if (row + HIGH_RES_ROWS <= rows)
npins = HIGH_RES_ROWS;
@@ -98,7 +128,6 @@
npins = rows - row;
for (i = 0; i < npins; ++i)
pbm_readpbmrow(ifp, bP[i] = bitrows[i], cols, format);
- printf("\033L%c%c", cols % 256, cols / 256);
for (col = 0; col < cols; ++col)
{
item = 0;
@@ -106,11 +135,10 @@
for (pin = i = 0; i < npins; i += 2, ++pin)
if (*(bP[i]++) == PBM_BLACK)
item |= 1 << (7 - pin);
- putchar(item);
+ *sP++ = item;
}
- putchar('\n'); /* flush buffer */
- printf("\033J\001"); /* 1/144 down */
- printf("\033L%c%c", cols % 256, cols / 256);
+ outstripe(stripe, sP, 'L');
+ sP = stripe;
for (col = 0; col < cols; ++col)
{
item = 0;
@@ -118,9 +146,11 @@
for (i = 1, pin = 0; i < npins; i += 2, ++pin)
if (*(bP[i]++) == PBM_BLACK)
item |= 1 << (7 - pin);
- putchar(item);
+ *sP++ = item;
}
- putchar('\n'); /* flush buffer */
- printf("\033J\017"); /* 15/144 down */
+ outstripe(stripe, sP, 'L');
+ printf("\033J\016"); /* 14/144 down, \n did 1/144 */
}
+ printf("\033@");
+ free(stripe);
}

View File

@ -1,58 +1,111 @@
*** ppm/picttoppm.c.orig Sat May 30 18:55:09 1998
--- ppm/picttoppm.c Sat May 30 18:59:35 1998
***************
*** 1437,1443 ****
return;
#else
FILE* pnmscale;
! char* tmpfile = tmpnam((char*)0);
char command[1024];
register byte* redsrc;
register byte* greensrc;
--- 1437,1443 ----
return;
#else
FILE* pnmscale;
! char* tmpfile = strdup("/tmp/ami.XXXXXXXX");
char command[1024];
register byte* redsrc;
register byte* greensrc;
***************
*** 1448,1459 ****
pixval maxval;
pixel* row;
pixel* rowp;
#if (defined(AMIGA) || defined(VMS))
char ami_tmpfile[L_tmpnam];
int ami_result;
! tmpnam(ami_tmpfile);
! if (!(pnmscale = fopen(ami_tmpfile, "w")))
pm_error("cannot create temporary file '%s'", ami_tmpfile);
#else /* AMIGA or VMS */
sprintf(command, "pnmscale -xsize %d -ysize %d > %s",
--- 1448,1461 ----
pixval maxval;
pixel* row;
pixel* rowp;
+ int fd;
#if (defined(AMIGA) || defined(VMS))
char ami_tmpfile[L_tmpnam];
int ami_result;
! strcpy(ami_tmpfile, "/tmp/ami.XXXXXXXX");
! fd = mkstemp(ami_tmpfile);
! if (!(pnmscale = fdopen(fd, "w")))
pm_error("cannot create temporary file '%s'", ami_tmpfile);
#else /* AMIGA or VMS */
sprintf(command, "pnmscale -xsize %d -ysize %d > %s",
***************
*** 1526,1531 ****
--- 1528,1534 ----
unlink(ami_tmpfile);
pm_perror("write error");
}
+ close(mkstemp(tmpfile));
sprintf(command, "pnmscale -xsize %d -ysize %d %s > %s",
rectwidth(&clipdst), rectheight(&clipdst), ami_tmpfile, tmpfile);
pm_message("running 'pnmscale -xsize %d -ysize %d' on a %d x %d image",
--- pgm/Makefile.orig Fri Jan 28 11:14:02 1994
+++ pgm/Makefile Mon Jan 11 00:18:46 1999
@@ -18,14 +18,16 @@
#CFLAGS = -g -O
LDFLAGS = -s
#LDFLAGS =
-INSTALLBINARIES = /usr/new/pbm
-INSTALLMANUALS1 = /usr/man/man1
+INSTALLBINARIES = $(PREFIX)/bin
+INSTALLMANUALS1 = $(PREFIX)/man/man1
SUFFIXMANUALS1 = 1
-INSTALLMANUALS3 = /usr/man/man3
+INSTALLMANUALS3 = $(PREFIX)/man/man3
SUFFIXMANUALS3 = 3
-INSTALLMANUALS5 = /usr/man/man5
+INSTALLMANUALS5 = $(PREFIX)/man/man5
SUFFIXMANUALS5 = 5
-MANCP = cp
+MANCP = install -c -m 0644
+INSTALLLIBS = $(PREFIX)/lib
+INSTALLDEFS = $(PREFIX)/include
PBMDIR = ../pbm
INCLUDEPBM = -I$(PBMDIR)
@@ -37,12 +39,13 @@
INCLUDE = -I.. $(INCLUDEPBM)
ALLCFLAGS = $(CFLAGS) $(INCLUDE)
LIBPGM = libpgm.a
+DEFPGM = pgm.h
PORTBINARIES = asciitopgm bioradtopgm fstopgm hipstopgm \
- lispmtopgm pbmtopgm pgmbentley pgmenhance pgmhist pgmkernel \
+ lispmtopgm pbmtopgm pgmbentley pgmenhance pgmhist \
pgmnoise pgmnorm pgmoil pgmramp pgmtofs pgmtolispm \
pgmtopbm psidtopgm spottopgm
-MATHBINARIES = pgmcrater pgmedge pgmtexture rawtopgm
+MATHBINARIES = pgmcrater pgmedge pgmtexture rawtopgm pgmkernel
BINARIES = $(PORTBINARIES) $(MATHBINARIES)
OBJECTS = asciitopgm.o bioradtopgm.o fstopgm.o hipstopgm.o \
@@ -56,18 +59,19 @@
MANUALS5 = pgm
-#all: binaries
-all: merge
-#install: install.bin
-install: install.merge
+all: binaries
+#all: merge
+install: install.bin
+#install: install.merge
binaries: $(BINARIES)
install.bin: binaries
cd $(INSTALLBINARIES) ; rm -f $(BINARIES)
- cp $(BINARIES) $(INSTALLBINARIES)
-
+ install -c -s -m 0755 $(BINARIES) $(INSTALLBINARIES)
+ install -c -m 0644 $(LIBPGM) $(INSTALLLIBS)
+ install -c -m 0644 $(DEFPGM) $(INSTALLDEFS)
merge: pgmmerge
pgmmerge: pgmmerge.c $(OBJECTS) $(LIBPGM) $(LIBPBM)
@@ -97,15 +101,15 @@
# Rule for plain programs.
-$(PORTBINARIES): pgm.h $(DEFPBM) $(LIBPGM) $(LIBPBM)
+$(PORTBINARIES): $(DEFPGM) $(DEFPBM) $(LIBPGM) $(LIBPBM)
$(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c $(LIBPGM) $(LIBPBM)
# Rule for math-dependent programs.
-$(MATHBINARIES): pgm.h $(DEFPBM) $(LIBPGM) $(LIBPBM)
+$(MATHBINARIES): $(DEFPGM) $(DEFPBM) $(LIBPGM) $(LIBPBM)
$(CC) $(ALLCFLAGS) $(LDFLAGS) -o $@ $@.c -lm $(LIBPGM) $(LIBPBM)
# Rule for objects.
-$(OBJECTS): pgm.h $(DEFPBM)
+$(OBJECTS): $(DEFPGM) $(DEFPBM)
$(CC) $(ALLCFLAGS) "-Dmain=$*_main" -c $*.c
# And libraries.
@@ -117,9 +121,9 @@
ar rc $(LIBPGM) libpgm1.o libpgm2.o
-ranlib $(LIBPGM)
-libpgm1.o: pgm.h $(DEFPBM) libpgm.h libpgm1.c
+libpgm1.o: $(DEFPGM) $(DEFPBM) lib$(DEFPGM) libpgm1.c
$(CC) $(ALLCFLAGS) -c libpgm1.c
-libpgm2.o: pgm.h $(DEFPBM) libpgm.h libpgm2.c $(DEFLIBPBM)
+libpgm2.o: $(DEFPGM) $(DEFPBM) lib$(DEFPGM) libpgm2.c $(DEFLIBPBM)
$(CC) $(ALLCFLAGS) -c libpgm2.c
# Other dependencies.
@@ -134,7 +138,6 @@
pgmedge pgmedge.o: pgmedge.c
pgmenhance pgmenhance.o: pgmenhance.c
pgmhist pgmhist.o: pgmhist.c
-pgmkernel pgmkernel.o: pgmkernel.c
pgmnoise pgmnoise.o: pgmnoise.c
pgmnorm pgmnorm.o: pgmnorm.c
pgmoil pgmoil.o: pgmoil.c
@@ -148,4 +151,4 @@
spottopgm spottopgm.o: spottopgm.c
clean:
- -rm -f *.o *.a *.cat *~ core $(BINARIES) pgmmerge
+ -rm -f *.o *.a *.cat *~ core *.core $(BINARIES) pgmmerge

View File

@ -1 +1 @@
toolkit, convert images between different formats
toolkit for conversion of images between different formats