2
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
3
/***********************************************************
5
Copyright (c) 1987 X Consortium
7
Permission is hereby granted, free of charge, to any person obtaining a copy
8
of this software and associated documentation files (the "Software"), to deal
9
in the Software without restriction, including without limitation the rights
10
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
copies of the Software, and to permit persons to whom the Software is
12
furnished to do so, subject to the following conditions:
14
The above copyright notice and this permission notice shall be included in
15
all copies or substantial portions of the Software.
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
Except as contained in this notice, the name of the X Consortium shall not be
25
used in advertising or otherwise to promote the sale, use or other dealings
26
in this Software without prior written authorization from the X Consortium.
29
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
33
Permission to use, copy, modify, and distribute this software and its
34
documentation for any purpose and without fee is hereby granted,
35
provided that the above copyright notice appear in all copies and that
36
both that copyright notice and this permission notice appear in
37
supporting documentation, and that the name of Digital not be
38
used in advertising or publicity pertaining to distribution of the
39
software without specific, written prior permission.
41
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
42
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
43
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
44
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
46
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
49
******************************************************************/
50
/* $XConsortium: ilbmhrzvert.c,v 1.15 94/04/17 20:28:24 dpw Exp $ */
52
/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
53
to use interleaved bitplanes instead of normal bitplanes */
55
#ifdef HAVE_DIX_CONFIG_H
56
#include <dix-config.h>
69
/* horizontal solid line
72
ilbmHorzS(pbase, nlwidth, auxDst, depthDst, x1, y1, len, rrops)
73
PixelType *pbase; /* pointer to base of bitmap */
74
register int nlwidth; /* width in longwords of bitmap */
77
int x1; /* initial point */
79
int len; /* length of line */
80
register unsigned char *rrops;
82
register PixelType *addrl;
83
register PixelType startmask;
84
register PixelType endmask;
85
register int nlmiddle;
89
/* force the line to go left to right
90
but don't draw the last point
98
/* all bits inside same longword */
99
if ( ((x1 & PIM) + len) < PPW) {
100
maskpartialbits(x1, len, startmask);
102
for (d = 0; d < depthDst; d++) {
103
addrl = ilbmScanline(pbase, x1, y1, auxDst);
104
pbase += nlwidth; /* @@@ NEXT PLANE @@@ */
108
*addrl &= ~startmask;
119
} /* for (d = ...) */
121
maskbits(x1, len, startmask, endmask, nlmiddle);
122
saveNLmiddle = nlmiddle;
124
for (d = 0; d < depthDst; d++) {
125
addrl = ilbmScanline(pbase, x1, y1, auxDst);
126
pbase += nlwidth; /* @@@ NEXT PLANE @@@ */
127
nlmiddle = saveNLmiddle;
132
*addrl++ &= ~startmask;
133
Duff (nlmiddle, *addrl++ = 0x0);
140
*addrl++ |= startmask;
141
Duff (nlmiddle, *addrl++ = ~0);
148
*addrl++ ^= startmask;
149
Duff (nlmiddle, *addrl++ ^= ~0);
157
} /* for (d = ... ) */
161
/* vertical solid line
162
this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates
163
better code. sigh. we know that len will never be 0 or 1, so
167
ilbmVertS(pbase, nlwidth, auxDst, depthDst, x1, y1, len, rrops)
168
PixelType *pbase; /* pointer to base of bitmap */
169
register int nlwidth; /* width in longwords of bitmap */
172
int x1, y1; /* initial point */
173
register int len; /* length of line */
174
unsigned char *rrops;
176
register PixelType *addrl;
177
register PixelType bitmask;
188
for (d = 0; d < depthDst; d++) {
189
addrl = ilbmScanline(pbase, x1, y1, auxDst);
190
pbase += nlwidth; /* @@@ NEXT PLANE @@@ */
195
bitmask = rmask[x1 & PIM];
196
Duff(len, *addrl &= bitmask; ilbmScanlineInc(addrl, auxDst) );
200
bitmask = mask[x1 & PIM];
201
Duff(len, *addrl |= bitmask; ilbmScanlineInc(addrl, auxDst) );
205
bitmask = mask[x1 & PIM];
206
Duff(len, *addrl ^= bitmask; ilbmScanlineInc(addrl, auxDst) );
212
} /* for (d = ...) */