1 /************************************************************
3 Copyright 1989, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
25 ********************************************************/
28 #ifndef __MIFILLARC_H__
29 #define __MIFILLARC_H__
31 #define FULLCIRCLE (360 * 64)
33 typedef struct _miFillArc
{
41 /* could use 64-bit integers */
42 typedef struct _miFillArcD
{
47 double ym
, yk
, xm
, xk
;
50 #define miFillArcEmpty(arc) (!(arc)->angle2 || \
51 !(arc)->width || !(arc)->height || \
52 (((arc)->width == 1) && ((arc)->height & 1)))
54 #define miCanFillArc(arc) (((arc)->width == (arc)->height) || \
55 (((arc)->width <= 800) && ((arc)->height <= 800)))
57 #define MIFILLARCSETUP() \
70 #define MIFILLARCSTEP(slw) \
80 slw = (x << 1) + dx; \
81 if ((e == xk) && (slw > 1)) \
84 #define MIFILLCIRCSTEP(slw) MIFILLARCSTEP(slw)
85 #define MIFILLELLSTEP(slw) MIFILLARCSTEP(slw)
87 #define miFillArcLower(slw) (((y + dy) != 0) && ((slw > 1) || (e != xk)))
89 typedef struct _miSliceEdge
{
96 } miSliceEdgeRec
, *miSliceEdgePtr
;
98 typedef struct _miArcSlice
{
99 miSliceEdgeRec edge1
, edge2
;
100 int min_top_y
, max_top_y
;
101 int min_bot_y
, max_bot_y
;
102 Bool edge1_top
, edge2_top
;
103 Bool flip_top
, flip_bot
;
106 #define MIARCSLICESTEP(edge) \
107 edge.x -= edge.stepx; \
111 edge.x -= edge.deltax; \
115 #define miFillSliceUpper(slice) \
116 ((y >= slice.min_top_y) && (y <= slice.max_top_y))
118 #define miFillSliceLower(slice) \
119 ((y >= slice.min_bot_y) && (y <= slice.max_bot_y))
121 #define MIARCSLICEUPPER(xl,xr,slice,slw) \
124 if (slice.edge1_top && (slice.edge1.x < xr)) \
125 xr = slice.edge1.x; \
126 if (slice.edge2_top && (slice.edge2.x > xl)) \
129 #define MIARCSLICELOWER(xl,xr,slice,slw) \
132 if (!slice.edge1_top && (slice.edge1.x > xl)) \
133 xl = slice.edge1.x; \
134 if (!slice.edge2_top && (slice.edge2.x < xr)) \
137 #define MIWIDEARCSETUP(x,y,dy,slw,e,xk,xm,yk,ym) \
162 #define MIFILLINARCSTEP(slw) \
172 slw = (inx << 1) + dx; \
173 if ((ine == inxk) && (slw > 1)) \
176 #define miFillInArcLower(slw) (((iny + dy) != 0) && \
177 ((slw > 1) || (ine != inxk)))
179 extern void miFillArcSetup(
181 miFillArcRec
* /*info*/
184 extern void miFillArcSliceSetup(
186 miArcSliceRec
* /*slice*/,
190 #endif /* __MIFILLARC_H__ */