1
/* pbmtoptx.c - read a portable bitmap and produce a Printronix printer file
3
** Copyright (C) 1988 by Jef Poskanzer.
5
** Permission to use, copy, modify, and distribute this software and its
6
** documentation for any purpose and without fee is hereby granted, provided
7
** that the above copyright notice appear in all copies and that both that
8
** copyright notice and this permission notice appear in supporting
9
** documentation. This software is provided "as is" without express or
15
static void putinit ARGS(( void ));
16
static void putbit ARGS(( bit b ));
17
static void putrest ARGS(( void ));
18
static void putitem ARGS(( void ));
26
register bit *bitrow, *bP;
27
int rows, cols, format, row, col;
28
char *usage = "[pbmfile]";
30
pbm_init( &argc, argv );
36
ifp = pm_openr( argv[1] );
40
pbm_readpbminit( ifp, &cols, &rows, &format );
41
bitrow = pbm_allocrow( cols );
44
for ( row = 0; row < rows; row++ )
46
pbm_readpbmrow( ifp, bitrow, cols, format );
47
for ( col = 0, bP = bitrow; col < cols; col++, bP++ )
60
static int bitsperitem, bitshift;
79
if ( bitsperitem == 6 )
82
item += 1 << bitshift;
90
if ( bitsperitem > 0 )