1 /* $XConsortium: out_blk.c,v 1.4 94/02/07 10:01:11 gildea Exp $ */
5 Copyright 1989-1991, Bitstream Inc., Cambridge, MA.
6 You are hereby granted permission under all Bitstream propriety rights to
7 use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo
8 software and the Bitstream Charter outline font for any purpose and without
9 restrictions; provided, that this notice is left intact on all copies of such
10 software or font and that Bitstream's trademark is acknowledged as shown below
11 on all unmodified copies of such font.
13 BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
16 BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
17 WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18 PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT
19 DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER
20 INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED
21 WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT.
27 /*************************** O U T _ B L K . C *********************************
29 * This is an output module for black-writer mode. *
31 *****************************************************************************/
34 #include "spdo_prv.h" /* General definitions for Speedo */
38 #define ABS(X) ( (X < 0) ? -X : X)
42 #define SHOW(X) printf("X = %d\n", X)
48 /***** GLOBAL VARIABLES *****/
50 /***** GLOBAL FUNCTIONS *****/
52 /***** EXTERNAL VARIABLES *****/
54 /***** EXTERNAL FUNCTIONS *****/
56 /***** STATIC VARIABLES *****/
58 /***** STATIC FUNCTIONS *****/
62 static void sp_add_intercept_black(PROTO_DECL2 fix15 y, fix15 x);
63 static void sp_proc_intercepts_black(PROTO_DECL1);
65 static void sp_add_intercept_black();
66 static void sp_proc_intercepts_black();
72 FUNCTION boolean init_black(specsarg)
74 specs_t GLOBALFAR *specsarg;
76 * init_out0() is called by sp_set_specs() to initialize the output module.
77 * Returns TRUE if output module can accept requested specifications.
78 * Returns FALSE otherwise.
82 printf("INIT_BLK()\n");
84 if (specsarg->flags & CURVES_OUT)
85 return FALSE; /* Curves out not supported */
92 FUNCTION boolean begin_char_black(Psw, Pmin, Pmax)
97 /* Called once at the start of the character generation process
101 printf("BEGIN_CHAR_BLACK(%3.1f, %3.1f, %3.1f, %3.1f, %3.1f, %3.1f\n",
102 (real)Psw.x / (real)sp_globals.onepix, (real)Psw.y / (real)sp_globals.onepix,
103 (real)Pmin.x / (real)sp_globals.onepix, (real)Pmin.y / (real)sp_globals.onepix,
104 (real)Pmax.x / (real)sp_globals.onepix, (real)Pmax.y / (real)sp_globals.onepix);
106 init_char_out(Psw,Pmin,Pmax);
113 FUNCTION void begin_contour_black(P1, outside)
117 /* Called at the start of each contour
122 printf("BEGIN_CONTOUR_BLACK(%3.1f, %3.1f, %s)\n",
123 (real)P1.x / (real)sp_globals.onepix, (real)P1.y / (real)sp_globals.onepix, outside? "outside": "inside");
125 sp_globals.x0_spxl = P1.x;
126 sp_globals.y0_spxl = P1.y;
127 sp_globals.y_pxl = (sp_globals.y0_spxl + sp_globals.pixrnd) >> sp_globals.pixshift;
132 FUNCTION void line_black(P1)
135 /* Called for each vector in the transformed character
138 register fix15 how_many_y; /* # of intercepts at y = n + 1/2 */
139 register fix15 yc, i; /* Current scan-line */
140 fix15 temp1; /* various uses */
141 fix15 temp2; /* various uses */
142 register fix31 dx_dy; /* slope of line in 16.16 form */
143 register fix31 xc; /* high-precision (16.16) x coordinate */
144 fix15 x0,y0,x1,y1; /* PIX.FRAC start and endpoints */
146 x0 = sp_globals.x0_spxl; /* get start of line (== current point) */
147 y0 = sp_globals.y0_spxl;
148 sp_globals.x0_spxl = x1 = P1.x; /* end of line */
149 sp_globals.y0_spxl = y1 = P1.y; /* (also update current point to end of line) */
151 yc = sp_globals.y_pxl; /* current scan line = end of last line */
152 sp_globals.y_pxl = (y1 + sp_globals.pixrnd) >> sp_globals.pixshift; /* calculate new end-scan sp_globals.line */
156 printf("LINE_BLACK(%3.4f, %3.4f)\n",
157 (real)P1.x/(real)sp_globals.onepix,
158 (real)P1.y/(real)sp_globals.onepix);
161 if (sp_globals.extents_running)
163 if (sp_globals.x0_spxl > sp_globals.bmap_xmax)
164 sp_globals.bmap_xmax = sp_globals.x0_spxl;
165 if (sp_globals.x0_spxl < sp_globals.bmap_xmin)
166 sp_globals.bmap_xmin = sp_globals.x0_spxl;
167 if (sp_globals.y0_spxl > sp_globals.bmap_ymax)
168 sp_globals.bmap_ymax = sp_globals.y0_spxl;
169 if (sp_globals.y0_spxl < sp_globals.bmap_ymin)
170 sp_globals.bmap_ymin = sp_globals.y0_spxl;
173 if (sp_globals.intercept_oflo) return;
175 if ((how_many_y = sp_globals.y_pxl - yc) == 0) return; /* Don't draw a null line */
177 if (how_many_y < 0) yc--; /* Predecrment downward lines */
179 if (yc > sp_globals.y_band.band_max) /* Is start point above band? */
181 if (sp_globals.y_pxl > sp_globals.y_band.band_max) return; /* line has to go down! */
182 how_many_y = sp_globals.y_pxl - (yc = sp_globals.y_band.band_max) - 1; /* Yes, limit it */
185 if (yc < sp_globals.y_band.band_min) /* Is start point below band? */
187 if (sp_globals.y_pxl < sp_globals.y_band.band_min) return; /* line has to go up! */
188 how_many_y = sp_globals.y_pxl - (yc = sp_globals.y_band.band_min); /* Yes, limit it */
191 xc = (fix31)(x0 + sp_globals.pixrnd) << (16 - sp_globals.pixshift); /* Original x coordinate with built in */
192 /* rounding. 16.16 form */
195 if ( (temp1 = (x1 - x0)) == 0) /* check for vertical line */
197 yc -= sp_globals.y_band.band_min; /* yc is now an offset relative to the band */
198 temp1 = (fix15)(xc >> 16);
201 if ((how_many_y += yc + 1) < 0) how_many_y = 0; /* can't go below 0 */
202 for (i = yc; i >= how_many_y; i--)
203 sp_add_intercept_black(i,temp1);
207 /* check to see that line doesn't extend beyond top of band */
208 if ((how_many_y += yc) > sp_globals.no_y_lists) how_many_y = sp_globals.no_y_lists;
209 for (i = yc; i != how_many_y; i++)
210 sp_add_intercept_black(i,temp1);
215 /* calculate dx_dy at 16.16 fixed point */
217 dx_dy = ( (fix31)temp1 << 16 )/(fix31)(y1 - y0);
219 /* We have to check for a @#$%@# possible multiply overflow */
220 /* by doing another @#$*& multiply. In assembly language, */
221 /* the program could just check the OVerflow flag or whatever*/
222 /* works on the particular processor. This C code is meant */
223 /* to be processor independant. */
225 temp1 = (yc << sp_globals.pixshift) - y0 + sp_globals.pixrnd;
226 /* This sees if the sign bits start at bit 15 */
227 /* if they do, no overflow has occurred */
229 temp2 = (fix15)(MULT16(temp1,(fix15)(dx_dy >> 16)) >> 15);
231 if ( (temp2 != (fix15)0xFFFF) &&
233 /* Overflow. Pick point closest to yc + .5 */
234 (ABS(temp1) < ABS((yc << sp_globals.pixshift) - y1 + sp_globals.pixrnd)) )
235 { /* use x1 instead of x0 */
236 xc = (fix31)(x1 + sp_globals.pixrnd) << (16 - sp_globals.pixshift);
240 /* calculate new xc at the center of the *current* scan line */
241 /* due to banding, yc may be several lines away from y0 */
242 /* xc += (yc + .5 - y0) * dx_dy */
243 /* This multiply generates a subpixel delta. */
244 /* So we shift it to be a 16.16 delta */
246 xc += ((fix31)temp1 * dx_dy) >> sp_globals.pixshift;
249 yc -= sp_globals.y_band.band_min; /* yc is now an offset relative to the band */
253 if (how_many_y == -1)
254 sp_add_intercept_black(yc, (fix15) (xc >> 16));
257 if ((how_many_y += yc + 1) < 0) how_many_y = 0; /* can't go below 0 */
258 for (i = yc; i >= how_many_y; i--)
260 temp1 = (fix15)(xc >> 16);
261 sp_add_intercept_black(i,temp1);
268 /* check to see that line doesn't extend beyond top of band */
270 sp_add_intercept_black(yc, (fix15) (xc >> 16));
273 if ((how_many_y += yc) > sp_globals.no_y_lists) how_many_y = sp_globals.no_y_lists;
274 for (i = yc; i != how_many_y; i++)
276 temp1 = (fix15)(xc >> 16);
277 sp_add_intercept_black(i,temp1);
285 FUNCTION boolean end_char_black()
287 /* Called when all character data has been output
288 * Return TRUE if output process is complete
289 * Return FALSE to repeat output of the transformed data beginning
290 * with the first contour
297 fix31 bmap_max, bmap_min;
301 printf("END_CHAR_BLACK()\n");
304 if (sp_globals.first_pass)
306 if (sp_globals.bmap_xmax >= sp_globals.bmap_xmin)
308 sp_globals.xmin = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift;
309 sp_globals.xmax = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift;
313 sp_globals.xmin = sp_globals.xmax = 0;
315 if (sp_globals.bmap_ymax >= sp_globals.bmap_ymin)
319 switch(sp_globals.tcb0.xtype)
321 case 1: /* 180 degree rotation */
322 if (sp_globals.specs.flags & CLIP_TOP)
324 sp_globals.clip_ymin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2));
325 sp_globals.clip_ymin = sp_globals.clip_ymin >> sp_globals.multshift;
326 bmap_min = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift;
327 sp_globals.clip_ymin = -1 * sp_globals.clip_ymin;
328 if (bmap_min < sp_globals.clip_ymin)
329 sp_globals.ymin = sp_globals.clip_ymin;
331 sp_globals.ymin = bmap_min;
333 if (sp_globals.specs.flags & CLIP_BOTTOM)
335 sp_globals.clip_ymax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2));
336 sp_globals.clip_ymax = sp_globals.clip_ymax >> sp_globals.multshift;
337 bmap_max = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift;
338 if (bmap_max < sp_globals.clip_ymax)
339 sp_globals.ymax = bmap_max;
341 sp_globals.ymax = sp_globals.clip_ymax;
343 sp_globals.clip_xmax = -sp_globals.xmin;
344 sp_globals.clip_xmin = ((sp_globals.set_width.x+32768L) >> 16) -
347 case 2: /* 90 degree rotation */
348 if (sp_globals.specs.flags & CLIP_TOP)
350 sp_globals.clip_xmin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2));
351 sp_globals.clip_xmin = sp_globals.clip_xmin >> sp_globals.multshift;
352 sp_globals.clip_xmin = -1 * sp_globals.clip_xmin;
353 bmap_min = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift;
354 if (bmap_min > sp_globals.clip_xmin)
355 sp_globals.clip_xmin = bmap_min;
357 /* normalize to x origin */
358 sp_globals.clip_xmin -= sp_globals.xmin;
360 if (sp_globals.specs.flags & CLIP_BOTTOM)
362 sp_globals.clip_xmax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2));
363 sp_globals.clip_xmax = sp_globals.clip_xmax >> sp_globals.multshift;
364 bmap_max = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift;
365 if (bmap_max < sp_globals.clip_xmax)
366 sp_globals.xmax = bmap_max;
368 sp_globals.xmax = sp_globals.clip_xmax;
369 sp_globals.clip_ymax = 0;
370 if ((sp_globals.specs.flags & CLIP_TOP) &&
371 (sp_globals.ymax > sp_globals.clip_ymax))
372 sp_globals.ymax = sp_globals.clip_ymax;
373 sp_globals.clip_ymin = ((sp_globals.set_width.y+32768L) >> 16);
374 if ((sp_globals.specs.flags & CLIP_BOTTOM) &&
375 (sp_globals.ymin < sp_globals.clip_ymin))
376 sp_globals.ymin = sp_globals.clip_ymin;
377 /* normalize to x origin */
378 sp_globals.clip_xmax -= sp_globals.xmin;
381 case 3: /* 270 degree rotation */
382 if (sp_globals.specs.flags & CLIP_TOP)
384 sp_globals.clip_xmin = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2));
385 sp_globals.clip_xmin = sp_globals.clip_xmin >> sp_globals.multshift;
386 sp_globals.clip_xmin = -1 * sp_globals.clip_xmin;
387 bmap_min = (sp_globals.bmap_xmin + sp_globals.pixrnd + 1) >> sp_globals.pixshift;
389 /* let the minimum be the larger of these two values */
390 if (bmap_min > sp_globals.clip_xmin)
391 sp_globals.clip_xmin = bmap_min;
393 /* normalize the x value to new xorgin */
394 sp_globals.clip_xmin -= sp_globals.xmin;
396 if (sp_globals.specs.flags & CLIP_BOTTOM)
398 sp_globals.clip_xmax = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2));
399 sp_globals.clip_xmax = sp_globals.clip_xmax >> sp_globals.multshift;
400 bmap_max = (sp_globals.bmap_xmax + sp_globals.pixrnd) >> sp_globals.pixshift;
402 /* let the max be the lesser of these two values */
403 if (bmap_max < sp_globals.clip_xmax)
405 sp_globals.xmax = bmap_max;
406 sp_globals.clip_xmax = bmap_max;
409 sp_globals.xmax = sp_globals.clip_xmax;
411 /* normalize the x value to new x origin */
412 sp_globals.clip_xmax -= sp_globals.xmin;
414 /* compute y clip values */
415 sp_globals.clip_ymax = ((sp_globals.set_width.y+32768L) >> 16);
416 if ((sp_globals.specs.flags & CLIP_TOP) &&
417 (sp_globals.ymax > sp_globals.clip_ymax))
418 sp_globals.ymax = sp_globals.clip_ymax;
419 sp_globals.clip_ymin = 0;
420 if ((sp_globals.specs.flags & CLIP_BOTTOM) &&
421 (sp_globals.ymin < sp_globals.clip_ymin))
422 sp_globals.ymin = sp_globals.clip_ymin;
424 default: /* this is for zero degree rotation and arbitrary rotation */
425 if (sp_globals.specs.flags & CLIP_TOP)
427 sp_globals.clip_ymax = (fix31)((fix31)EM_TOP * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2));
428 sp_globals.clip_ymax = sp_globals.clip_ymax >> sp_globals.multshift;
429 bmap_max = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift;
430 if (bmap_max > sp_globals.clip_ymax)
431 sp_globals.ymax = bmap_max;
433 sp_globals.ymax = sp_globals.clip_ymax;
435 if (sp_globals.specs.flags & CLIP_BOTTOM)
437 sp_globals.clip_ymin = (fix31)((fix31)(-1 * EM_BOT) * sp_globals.tcb0.yppo + ((1<<sp_globals.multshift)/2));
438 sp_globals.clip_ymin = sp_globals.clip_ymin >> sp_globals.multshift;
439 sp_globals.clip_ymin = - sp_globals.clip_ymin;
440 bmap_min = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift;
441 if (bmap_min < sp_globals.clip_ymin)
442 sp_globals.ymin = sp_globals.clip_ymin;
444 sp_globals.ymin = bmap_min;
446 sp_globals.clip_xmin = -sp_globals.xmin;
447 sp_globals.clip_xmax = ((sp_globals.set_width.x+32768L) >> 16) -
451 if ( !(sp_globals.specs.flags & CLIP_TOP))
453 sp_globals.ymax = (sp_globals.bmap_ymax + sp_globals.pixrnd) >> sp_globals.pixshift;
456 if ( !(sp_globals.specs.flags & CLIP_BOTTOM))
459 sp_globals.ymin = (sp_globals.bmap_ymin + sp_globals.pixrnd + 1) >> sp_globals.pixshift;
463 sp_globals.ymin = sp_globals.ymax = 0;
466 /* add in the rounded out part (from xform.) of the left edge */
467 if (sp_globals.tcb.xmode == 0) /* for X pix is function of X orus only add the round */
468 xorg = (((fix31)sp_globals.xmin << 16) + (sp_globals.rnd_xmin << sp_globals.poshift));
470 if (sp_globals.tcb.xmode == 1) /* for X pix is function of -X orus only, subtr. round */
471 xorg = (((fix31)sp_globals.xmin << 16) - (sp_globals.rnd_xmin << sp_globals.poshift)) ;
473 xorg = (fix31)sp_globals.xmin << 16; /* for other cases don't use round on x */
475 if (sp_globals.tcb.ymode == 2) /* for Y pix is function of X orus only, add round error */
476 yorg = (((fix31)sp_globals.ymin << 16) + (sp_globals.rnd_xmin << sp_globals.poshift));
478 if (sp_globals.tcb.ymode == 3) /* for Y pix is function of -X orus only, sub round */
479 yorg = (((fix31)sp_globals.ymin << 16) - (sp_globals.rnd_xmin << sp_globals.poshift));
480 else /* all other cases have no round error on yorg */
481 yorg = (fix31)sp_globals.ymin << 16;
483 open_bitmap(sp_globals.set_width.x, sp_globals.set_width.y, xorg, yorg,
484 sp_globals.xmax - sp_globals.xmin, sp_globals.ymax - sp_globals.ymin);
485 if (sp_globals.intercept_oflo)
487 sp_globals.y_band.band_min = sp_globals.ymin;
488 sp_globals.y_band.band_max = sp_globals.ymax;
489 init_intercepts_out();
490 sp_globals.first_pass = FALSE;
491 sp_globals.extents_running = FALSE;
496 sp_proc_intercepts_black();
503 if (sp_globals.intercept_oflo)
505 reduce_band_size_out();
506 init_intercepts_out();
511 sp_proc_intercepts_black();
514 init_intercepts_out();
525 FUNCTION LOCAL void sp_add_intercept_black(y, x)
527 fix15 y; /* Y coordinate in relative pixel units */
528 /* (0 is lowest sample in band) */
529 fix15 x; /* X coordinate of intercept in subpixel units */
531 /* Called by line() to add an intercept to the intercept list structure
535 register fix15 from; /* Insertion pointers for the linked list sort */
539 printf(" Add intercept(%2d, %d)\n", y + sp_globals.y_band.band_min,x);
541 /* Bounds checking IS done in debug mode */
542 if (y < 0) /* Y value below bottom of current band? */
544 printf(" Intecerpt less than 0!!!\007\n");
548 if (y > (sp_globals.no_y_lists - 1)) /* Y value above top of current band? */
550 printf(" Intercept too big for band!!!!!\007\n");
555 /* Store new values */
557 sp_intercepts.car[sp_globals.next_offset] = x;
559 /* Find slot to insert new element (between from and to) */
561 from = y; /* Start at list head */
563 while( (to = sp_intercepts.cdr[from]) >= sp_globals.first_offset) /* Until to == end of list */
565 if (x <= sp_intercepts.car[to]) /* If next item is larger than or same as this one... */
566 goto insert_element; /* ... drop out and insert here */
567 from = to; /* move forward in list */
570 insert_element: /* insert element "sp_globals.next_offset" between elements "from" */
573 sp_intercepts.cdr[from] = sp_globals.next_offset;
574 sp_intercepts.cdr[sp_globals.next_offset] = to;
576 if (++sp_globals.next_offset >= MAX_INTERCEPTS) /* Intercept buffer full? */
578 sp_globals.intercept_oflo = TRUE;
579 /* There may be a few more calls to "add_intercept" from the current line */
580 /* To avoid problems, we set next_offset to a safe value. We don't care */
581 /* if the intercept table gets trashed at this point */
582 sp_globals.next_offset = sp_globals.first_offset;
589 FUNCTION LOCAL void sp_proc_intercepts_black()
592 /* Called by sp_make_char to output accumulated intercept lists
593 * Clips output to sp_globals.xmin, sp_globals.xmax, sp_globals.ymin, sp_globals.ymax boundaries
597 register fix15 from, to; /* Start and end of run in pixel units
598 relative to left extent of character */
600 register fix15 scan_line;
601 fix15 first_y, last_y;
603 boolean clipleft, clipright;
606 printf("\nIntercept lists:\n");
610 if ((sp_globals.specs.flags & CLIP_LEFT) != 0)
614 if ((sp_globals.specs.flags & CLIP_RIGHT) != 0)
618 if (clipleft || clipright)
620 xmax = sp_globals.clip_xmax;
621 xmin = sp_globals.clip_xmin;
624 xmax = ((sp_globals.set_width.x+32768L) >> 16);
627 if ((first_y = sp_globals.y_band.band_max) >= sp_globals.ymax)
628 first_y = sp_globals.ymax - 1; /* Clip to sp_globals.ymax boundary */
630 if ((last_y = sp_globals.y_band.band_min) < sp_globals.ymin)
631 last_y = sp_globals.ymin; /* Clip to sp_globals.ymin boundary */
633 last_y -= sp_globals.y_band.band_min;
635 /* Print out all of the intercept info */
636 scan_line = sp_globals.ymax - first_y - 1;
638 for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++)
640 i = y; /* Index head of intercept list */
641 while ((i = sp_intercepts.cdr[i]) != 0) /* Link to next intercept if present */
643 if ((from = sp_intercepts.car[i] - sp_globals.xmin) < 0)
644 from = 0; /* Clip to sp_globals.xmin boundary */
645 i = sp_intercepts.cdr[i]; /* Link to next intercept */
646 if (i == 0) /* End of list? */
648 printf("****** proc_intercepts: odd number of intercepts\n");
651 if ((to = sp_intercepts.car[i]) > sp_globals.xmax)
652 to = sp_globals.xmax - sp_globals.xmin; /* Clip to sp_globals.xmax boundary */
654 to -= sp_globals.xmin;
655 printf(" Y = %2d (scanline %2d): %d %d:\n",
656 y + sp_globals.y_band.band_min, scan_line, from, to);
662 scan_line = sp_globals.ymax - first_y - 1;
664 for (y = first_y - sp_globals.y_band.band_min; y >= last_y; y--, scan_line++)
666 i = y; /* Index head of intercept list */
667 while ((i = sp_intercepts.cdr[i]) != 0) /* Link to next intercept if present */
669 if ((from = sp_intercepts.car[i] - sp_globals.xmin) < 0)
670 from = 0; /* Clip to sp_globals.xmin boundary */
671 i = sp_intercepts.cdr[i]; /* Link to next intercept */
673 if ((to = sp_intercepts.car[i]) > sp_globals.xmax)
674 to = sp_globals.xmax - sp_globals.xmin; /* Clip to sp_globals.xmax boundary */
676 to -= sp_globals.xmin;
679 if (from >= sp_globals.xmax - sp_globals.xmin)
701 set_bitmap_bits(scan_line, from, to);