diff options
Diffstat (limited to 'src/Type1/regions.h')
-rw-r--r-- | src/Type1/regions.h | 69 |
1 files changed, 53 insertions, 16 deletions
diff --git a/src/Type1/regions.h b/src/Type1/regions.h index 3870cf4..9d27e76 100644 --- a/src/Type1/regions.h +++ b/src/Type1/regions.h @@ -26,6 +26,7 @@ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF * THIS SOFTWARE. */ +/* $XFree86: xc/lib/font/Type1/regions.h,v 1.8 2001/06/15 08:09:20 alanh Exp $ */ /*SHARED*/ #define Interior(p,rule) t1_Interior(p,rule) @@ -33,21 +34,27 @@ #define Intersect(a1,a2) t1_Intersect(a1,a2) #define Complement(area) t1_Complement(area) #define Overlap(a1,a2) t1_OverLap(a1,a2) - -struct region *t1_Interior(); /* returns the interior of a closed path */ + + +/* returns the interior of a closed path */ +extern struct region *t1_Interior ( struct segment *p, int fillrule ); +#if 0 struct region *t1_Union(); /* set union of paths or regions */ struct region *t1_Intersect(); /* set intersection of regions */ struct region *t1_Complement(); /* complement of a region */ int t1_Overlap(); /* returns a Boolean; TRUE if regions overlap */ - -#define INFINITY t1_Infinity +#endif + +#define TT_INFINITY t1_Infinity /*END SHARED*/ /*SHARED*/ #define ChangeDirection(type,R,x,y,dy) t1_ChangeDirection(type,R,x,y,dy) -void t1_ChangeDirection(); /* called when we change direction in Y */ +/* called when we change direction in Y */ +extern void t1_ChangeDirection ( int type, struct region *R, fractpel x, + fractpel y, fractpel dy ); #define CD_FIRST -1 /* enumeration of ChangeDirection type */ #define CD_CONTINUE 0 /* enumeration of ChangeDirection type */ #define CD_LAST 1 /* enumeration of ChangeDirection type */ @@ -63,17 +70,37 @@ void t1_ChangeDirection(); /* called when we change direction in Y */ #define MoveEdges(R,dx,dy) t1_MoveEdges(R,dx,dy) #define UnJumble(R) t1_UnJumble(R) -void t1_MoreWorkArea(); /* get longer edge list for stepping */ -struct region *t1_CopyRegion(); /* duplicate a region */ -void t1_KillRegion(); /* destroy a region */ -struct region *t1_BoxClip(); /* clip a region to a rectangle */ -struct edgelist *t1_SortSwath(); /* sort edges onto growing edge list */ -struct edgelist *t1_SwathUnion(); /* 'union' two edges into a swath */ -struct segment *t1_RegionBounds(); /* returns bounding box of a region */ -struct region *t1_CoerceRegion(); /* force text to become a true region */ -void t1_MoveEdges(); /* moves the edge values in a region */ -void t1_UnJumble(); /* sort the edges and reset the jumbled flag */ +typedef struct edgelist *(*SwathFunc)(struct edgelist *, struct edgelist *); + +/* get longer edge list for stepping */ +extern void t1_MoreWorkArea ( struct region *R, fractpel x1, fractpel y1, + fractpel x2, fractpel y2 ); +/* duplicate a region */ +extern struct region *t1_CopyRegion ( struct region *area ); +/* destroy a region */ +extern void t1_KillRegion ( struct region *area ); +/* clip a region to a rectangle */ +extern struct region *t1_BoxClip ( struct region *R, pel xmin, pel ymin, + pel xmax, pel ymax ); +/* sort edges onto growing edge list */ +extern struct edgelist *t1_SortSwath ( struct edgelist *anchor, + struct edgelist *edge, + SwathFunc swathfcn ); +/* 'union' two edges into a swath */ +extern struct edgelist *t1_SwathUnion ( struct edgelist *before0, + struct edgelist *edge ); +/* returns bounding box of a region */ +extern struct segment *t1_RegionBounds ( struct region *R ); +#ifdef notdef +/* force text to become a true region */ +struct region *t1_CoerceRegion(struct textpath *tp); +#endif +/* moves the edge values in a region */ +extern void t1_MoveEdges ( struct region *R, fractpel dx, fractpel dy ); +/* sort the edges and reset the jumbled flag */ +extern void t1_UnJumble ( struct region *region ); + /*END SHARED*/ /*SHARED*/ @@ -95,9 +122,11 @@ void t1_UnJumble(); /* sort the edges and reset the jumbled flag */ else if (x2 > R->edgexmax) R->edgexmax = x2; \ } +#ifndef FONTMODULE #ifndef __sxg__ #include <limits.h> #endif +#endif #ifdef SHRT_MIN #define MINPEL SHRT_MIN #else @@ -122,6 +151,9 @@ to be made unique for that reason (i.e., references > 1). /*END SHARED*/ /*SHARED*/ +typedef void (*NewEdgeFunc)(struct region *, + fractpel, fractpel, fractpel, fractpel, int); + struct region { XOBJ_COMMON /* xobject common data define 3-26-91 PNM */ /* type = REGIONTYPE */ @@ -144,7 +176,7 @@ scratchpad areas used while the region is being built: struct edgelist *lastedge,*firstedge; /* last and first edges in subpath */ pel *edge; /* pointer to array of X values for edge */ fractpel edgeYstop; /* Y value where 'edges' array ends */ - void (*newedgefcn)(); /* function to use when building a new edge */ + NewEdgeFunc newedgefcn; /* function to use when building a new edge */ struct strokeinfo *strokeinfo; /* scratchpad info during stroking only */ } ; /* @@ -211,3 +243,8 @@ Interior() rule enumerations: #define CONTINUITY 0x80 /* can be added to above rules; e.g. WINDINGRULE+CONTINUITY */ /*END SHARED*/ + +/* dump a region structure */ +extern void t1_DumpArea ( struct region *area ); +/* dump a region's edge list */ +extern void t1_DumpEdges ( struct edgelist *edges ); |