1a1d141d5Smrg/*
2a1d141d5Smrg * header file for transformed coordinate system.  No rotations
33bee1c92Smrg * supported, as ellipses cannot be rotated in X.
4a1d141d5Smrg */
5a1d141d5Smrg
6a1d141d5Smrgtypedef struct _transform {
7a1d141d5Smrg	double	mx, bx;
8a1d141d5Smrg	double	my, by;
9a1d141d5Smrg} Transform;
10a1d141d5Smrg
11a1d141d5Smrgtypedef struct _TPoint {
12a1d141d5Smrg	double	x, y;
13a1d141d5Smrg} TPoint;
14a1d141d5Smrg
15a1d141d5Smrgtypedef struct _TRectangle {
16a1d141d5Smrg	double	x, y, width, height;
17a1d141d5Smrg} TRectangle;
18a1d141d5Smrg
19a1d141d5Smrg# define Xx(x,y,t)	((int)((t)->mx * (x) + (t)->bx + 0.5))
20a1d141d5Smrg# define Xy(x,y,t)	((int)((t)->my * (y) + (t)->by + 0.5))
21a1d141d5Smrg# define Xwidth(w,h,t)	((int)((t)->mx * (w) + 0.5))
22a1d141d5Smrg# define Xheight(w,h,t)	((int)((t)->my * (h) + 0.5))
23a1d141d5Smrg# define Tx(x,y,t)	((((double) (x)) - (t)->bx) / (t)->mx)
24a1d141d5Smrg# define Ty(x,y,t)	((((double) (y)) - (t)->by) / (t)->my)
25a1d141d5Smrg# define Twidth(w,h,t)	(((double) (w)) / (t)->mx)
26a1d141d5Smrg# define Theight(w,h,t)	(((double) (h)) / (t)->my)
27a1d141d5Smrg
282ddb6cf1Smrgextern void Trectangle (const Transform *t, const TRectangle *in, TRectangle *out);
29a1d141d5Smrgextern void SetTransform (Transform *t,
30a1d141d5Smrg                          int xx1, int xx2, int xy1, int xy2,
31a1d141d5Smrg                          double tx1, double tx2, double ty1, double ty2);
32