convert line ends
[canaan.git] / prj / tech / libsrc / dev2d / f16pix16.c
blobd1ebc61f5902b0f9d46895894c2184844fbed8ce
1 /*
2 * $Source: s:/prj/tech/libsrc/dev2d/RCS/f16pix16.c $
3 * $Revision: 1.1 $
4 * $Author: KEVIN $
5 * $Date: 1996/04/10 15:44:38 $
7 * Routines for drawing pixels into a flat 8 canvas.
9 * This file is part of the dev2d library.
11 * $Log: f16pix16.c $
12 * Revision 1.1 1996/04/10 15:44:38 KEVIN
13 * Initial revision
17 #include <grd.h>
19 /* draws an unclipped pixel of the given color at (x, y) on the canvas. */
20 void flat16_norm_upix16(int c16, int x, int y)
22 ushort *p;
24 p = (ushort *)(grd_bm.bits + grd_bm.row*y + 2*x);
25 *p = c16;
28 void flat16_clut_upix16 (int c16, int x, int y)
30 ushort *p;
31 ushort *clut16;
33 p = (ushort *)(grd_bm.bits + grd_bm.row*y + 2*x);
34 clut16 = (ushort *)(grd_gc.fill_parm);
35 *p = clut16[c16&255] + clut16[256+(c16>>8)];
38 void flat16_xor_upix16 (int c16, int x, int y)
40 ushort *p;
42 p = (ushort *)(grd_bm.bits + grd_bm.row*y + 2*x);
43 *p = c16 ^ *p;
46 void flat16_tluc_upix16 (int c16, int x, int y)
48 ushort *p;
49 ushort *clut16;
51 p = (ushort *)(grd_bm.bits + grd_bm.row*y + 2*x);
52 if (((uint )c16) <= 255) {
53 clut16=(ushort *)(tluc8tab[c16]);
54 if (clut16!=NULL) {
55 c16 = *p;
56 *p = clut16[c16&255]+clut16[256+(c16>>8)];
57 return;
60 *p = c16;
63 #pragma off (unreferenced)
64 void flat16_solid_upix16 (int c16, int x, int y)
66 ushort *p;
68 p = (ushort *)(grd_bm.bits + grd_bm.row*y + 2*x);
69 *p = (ushort )grd_gc.fill_parm;
71 #pragma on (unreferenced)