18 #ifdef __GO32__ // dos386/djgpp
26 "ljii:LaserJet II Bitmap File (150 dpi):0:ljii:33:ljii\n";
33 void plD_line_ljii(
PLStream *,
short,
short,
short,
short );
34 void plD_polyline_ljii(
PLStream *,
short *,
short *,
PLINT );
48 #define OF pls->OutFile
49 #define DPI 150 // Resolution Dots per Inch
52 #define XDOTS 1104L // # dots across
53 #define YDOTS 1410L // # dots down
54 #define BPROW XDOTS / 8L // # bytes across
55 #define NBYTES BPROW * YDOTS // total number of bytes
63 {
'\200',
'\100',
'\040',
'\020',
'\010',
'\004',
'\002',
'\001' };
71 static char _HUGE *bitmap;
75 #ifndef ENABLE_DYNDRIVERS
76 pdt->
pl_MenuStr =
"LaserJet II Bitmap File (150 dpi)";
148 if ( ( bitmap = (
char _HUGE *) halloc( (
long) NBYTES,
sizeof (
char ) ) ) == NULL )
149 plexit(
"Out of memory in call to calloc" );
151 if ( ( bitmap = (
void *) calloc( NBYTES,
sizeof (
char ) ) ) == NULL )
152 plexit(
"Out of memory in call to calloc" );
157 fprintf(
OF,
"%cE", ESC );
167 plD_line_ljii(
PLStream *pls,
short x1a,
short y1a,
short x2a,
short y2a )
171 int x1 = x1a, y1 = y1a, x2 = x2a, y2 = y2a;
172 PLINT x1b, y1b, x2b, y2b;
177 y1 = dev->
ymax - ( y1 - dev->
ymin );
178 y2 = dev->
ymax - ( y2 - dev->
ymin );
185 x1b = x1, x2b = x2, y1b = y1, y2b = y2;
186 length = (
PLFLT) sqrt( (
double)
187 ( ( x2b - x1b ) * ( x2b - x1b ) + ( y2b - y1b ) * ( y2b - y1b ) ) );
191 dx = ( x2 - x1 ) / length;
192 dy = ( y2 - y1 ) / length;
199 for ( i = 1; i <= (int) length; i++ )
210 plD_polyline_ljii(
PLStream *pls,
short *xa,
short *ya,
PLINT npts )
214 for ( i = 0; i < npts - 1; i++ )
215 plD_line_ljii( pls, xa[i], ya[i], xa[i + 1], ya[i + 1] );
231 fprintf(
OF,
"%c*p%dX", ESC, CURX );
232 fprintf(
OF,
"%c*p%dY", ESC, CURY );
236 fprintf(
OF,
"%c*t%dR", ESC,
DPI );
237 fprintf(
OF,
"%c*r1A", ESC );
241 for ( j = 0; j < YDOTS; j++ )
243 fprintf(
OF,
"%c*b%ldW", ESC, BPROW );
244 for ( i = 0; i < BPROW; i++ )
245 putc( *( bitmap + i + j * BPROW ),
OF );
251 fprintf(
OF,
"%c*rB", ESC );
252 fprintf(
OF,
"%c", FF );
256 memset( bitmap,
'\0', NBYTES );
286 fprintf(
OF,
"%cE", ESC );
288 free( (
void *) bitmap );
323 index = x / 8 + y * BPROW;
324 *( bitmap + index ) = *( bitmap + index ) | mask[x % 8];
void(* plD_line_fp)(struct PLStream_struct *, short, short, short, short)
PLDLLIMPEXP_DRIVER void plD_dispatch_init_ljii(PLDispatchTable *pdt)
void(* plD_eop_fp)(struct PLStream_struct *)
void(* plD_state_fp)(struct PLStream_struct *, PLINT)
void(* plD_tidy_fp)(struct PLStream_struct *)
void plOpenFile(PLStream *pls)
void plCloseFile(PLStream *pls)
void plGetFam(PLStream *pls)
void PLFLT PLINT PLINT PLFLT x
void plFamInit(PLStream *pls)
void(* plD_polyline_fp)(struct PLStream_struct *, short *, short *, PLINT)
PLDev * plAllocDev(PLStream *pls)
void(* plD_esc_fp)(struct PLStream_struct *, PLINT, void *)
void(* plD_bop_fp)(struct PLStream_struct *)
void PLFLT PLINT PLINT PLFLT PLFLT y
void plP_setpxl(PLFLT xpmm, PLFLT ypmm)
#define PLDLLIMPEXP_DRIVER
void plP_setphy(PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax)
void plRotPhy(PLINT orient, PLINT xmin, PLINT ymin, PLINT xmax, PLINT ymax, PLINT *px, PLINT *py)
dx
if { $zoomopts($this,1) == 0 } then {
plD_polyline_fp pl_polyline
void(* plD_init_fp)(struct PLStream_struct *)
void plexit(const char *errormsg)