1
/* $TOG: mifpoly.h /main/10 1998/02/09 14:47:09 kaleb $ */
2
/***********************************************************
4
Copyright 1987, 1998 The Open Group
8
The above copyright notice and this permission notice shall be included in
9
all copies or substantial portions of the Software.
11
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
15
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
Except as contained in this notice, the name of The Open Group shall not be
19
used in advertising or otherwise to promote the sale, use or other dealings
20
in this Software without prior written authorization from The Open Group.
23
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
27
Permission to use, copy, modify, and distribute this software and its
28
documentation for any purpose and without fee is hereby granted,
29
provided that the above copyright notice appear in all copies and that
30
both that copyright notice and this permission notice appear in
31
supporting documentation, and that the name of Digital not be
32
used in advertising or publicity pertaining to distribution of the
33
software without specific, written prior permission.
35
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
36
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
37
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
38
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
39
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
40
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
43
******************************************************************/
48
#define EPSILON 0.000001
49
#define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON)
50
#define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON)
51
#define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \
53
#define ROUNDTOINT(x) ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5)))
54
#define ISZERO(x) (fabs((x)) <= EPSILON)
55
#define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y))
56
#define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y))
57
#define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y))
63
#define SQSECANT 108.856472512142 /* 1/sin^2(11/2) - for 11o miter cutoff */
64
#define D2SECANT 5.21671526231167 /* 1/2*sin(11/2) - max extension per width */
68
#define ICEIL(x) ((int)ceil(x))
72
static __inline int ICEIL(double x)
75
return ((x == _cTmp) || (x < 0.0)) ? _cTmp : _cTmp+1;
78
#define ICEIL(x) ((((x) == (_cTmp = (x))) || ((x) < 0.0)) ? _cTmp : _cTmp+1)
79
#define ICEILTEMPDECL static int _cTmp;
84
/* Point with sub-pixel positioning. In this case we use doubles, but
85
* see mifpolycon.c for other suggestions
87
typedef struct _SppPoint {
89
} SppPointRec, *SppPointPtr;
91
typedef struct _SppArc {
92
double x, y, width, height;
93
double angle1, angle2;
94
} SppArcRec, *SppArcPtr;
98
extern void miFillSppPoly(
109
#endif /* MIFPOLY_H */