convert line ends
[canaan.git] / prj / tech / libsrc / g2 / fl8lin.c
blobe3468e6d812d0757ddef9efdccd760f97028fd6e
1 /*
2 * $Source: s:/prj/tech/libsrc/g2/RCS/fl8lin.c $
3 * $Revision: 1.1 $
4 * $Author: KEVIN $
5 * $Date: 1996/04/10 17:26:08 $
7 * Routines for drawing fixed-point lines onto a flat 8 canvas.
9 * This file is part of the g2 library.
13 #include <dev2d.h>
14 #include <mathmac.h>
15 #include <plytyp.h>
17 /* same for norm, solid and clut */
19 #undef flat8_pixel_fill
20 #define flat8_pixel_fill(_p, _c) \
21 do { \
22 *_p = _c; \
23 } while (0)
25 void flat8_uline (uchar c, grs_vertex *v0, grs_vertex *v1)
27 #include <fl8lin.h>
30 /* norm */
31 void flat8_uline_norm (grs_vertex *v0, grs_vertex *v1)
33 flat8_uline(grd_gc.fcolor, v0, v1);
36 /* solid */
38 void flat8_uline_solid (grs_vertex *v0, grs_vertex *v1)
40 flat8_uline (grd_gc.fill_parm, v0, v1);
43 /* clut */
45 void flat8_uline_clut (grs_vertex *v0, grs_vertex *v1)
47 uchar c = (uchar )(((uchar *)grd_gc.fill_parm)[grd_gc.fcolor]);
48 flat8_uline (c, v0, v1);
51 /* xor */
53 #undef flat8_pixel_fill
54 #define flat8_pixel_fill(_p, _c) \
55 do { \
56 *_p = _c ^ *_p; \
57 } while (0)
59 void flat8_uline_xor (grs_vertex *v0, grs_vertex *v1)
61 uchar c=grd_gc.fcolor;
62 #include <fl8lin.h>
65 /* blend */
67 #undef flat8_pixel_fill
68 #define flat8_pixel_fill(_p, _c) \
69 do { \
70 *_p = clut[*_p]; \
71 } while (0)
73 void flat8_uline_blend (grs_vertex *v0, grs_vertex *v1)
75 uchar c = grd_gc.fcolor;
76 uchar *clut = tluc8tab[c];
77 if (clut == NULL) {
78 flat8_uline (c, v0, v1);
79 } else {
80 #include <fl8lin.h>