[Commit] libic/src ic.h,1.8,1.9 icint.h,1.7,1.8 icrect.c,1.2,1.3 ictrap.c,1.5,1.6 ictri.c,1.4,1.5

Carl Worth commit@keithp.com
Fri, 25 Apr 2003 14:24:40 -0700


Committed by: cworth

Update of /local/src/CVS/libic/src
In directory home.keithp.com:/tmp/cvs-serv18727/src

Modified Files:
	ic.h icint.h icrect.c ictrap.c ictri.c 
Log Message:
Remove X datatypes from public interface

Index: ic.h
===================================================================
RCS file: /local/src/CVS/libic/src/ic.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ic.h	25 Apr 2003 20:18:13 -0000	1.8
+++ ic.h	25 Apr 2003 21:24:38 -0000	1.9
@@ -103,8 +103,33 @@
 
 typedef int IcFixed16_16;
 
+typedef struct _IcPointFixed {
+    IcFixed16_16  x, y;
+} IcPointFixed;
+
+typedef struct _IcLineFixed {
+    IcPointFixed	p1, p2;
+} IcLineFixed;
+
+/* XXX: It's goofy that IcRectangle has integers while all the other
+   datatypes have fixed-point values. (Though by design,
+   IcFillRectangles is designed to fill only whole pixels) */
+typedef struct _IcRectangle {
+    int x, y;
+    int width, height;
+} IcRectangle;
+
+typedef struct _IcTriangle {
+    IcPointFixed	p1, p2, p3;
+} IcTriangle;
+
+typedef struct _IcTrapezoid {
+    IcFixed16_16  top, bottom;
+    IcLineFixed	left, right;
+} IcTrapezoid;
+
 typedef struct _IcTransform {
-    IcFixed16_16    matrix[3][3];
+    IcFixed16_16  matrix[3][3];
 } IcTransform;
 
 int
@@ -148,7 +173,7 @@
 IcFillRectangles (char			op,
 		  IcImage		*dst,
 		  const IcColor		*color,
-		  const XRectangle	*rects,
+		  const IcRectangle	*rects,
 		  int			nRects);
 
 /* ictrap.c */
@@ -160,7 +185,7 @@
 		       IcImage		*dst,
 		       int		xSrc,
 		       int		ySrc,
-		       const XTrapezoid *traps,
+		       const IcTrapezoid *traps,
 		       int		ntrap);
 
 /* ictri.c */
@@ -171,7 +196,7 @@
 		      IcImage		*dst,
 		      int		xSrc,
 		      int		ySrc,
-		      const XTriangle	*tris,
+		      const IcTriangle	*tris,
 		      int		ntris);
 
 void
@@ -180,7 +205,7 @@
 		     IcImage		*dst,
 		     int		xSrc,
 		     int		ySrc,
-		     const XPointFixed	*points,
+		     const IcPointFixed	*points,
 		     int		npoints);
 
 
@@ -190,7 +215,7 @@
 		   IcImage		*dst,
 		   int			xSrc,
 		   int			ySrc,
-		   const XPointFixed	*points,
+		   const IcPointFixed	*points,
 		   int			npoints);
 
 /* ic.c */

Index: icint.h
===================================================================
RCS file: /local/src/CVS/libic/src/icint.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- icint.h	17 Apr 2003 15:48:22 -0000	1.7
+++ icint.h	25 Apr 2003 21:24:38 -0000	1.8
@@ -24,6 +24,8 @@
 #ifndef _ICINT_H_
 #define _ICINT_H_
 
+#include "ic.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
@@ -758,7 +760,7 @@
 
 void
 IcRasterizeTrapezoid (IcImage		*pMask,
-		      const XTrapezoid  *pTrap,
+		      const IcTrapezoid  *pTrap,
 		      int		x_off,
 		      int		y_off);
 

Index: icrect.c
===================================================================
RCS file: /local/src/CVS/libic/src/icrect.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- icrect.c	17 Apr 2003 15:48:22 -0000	1.2
+++ icrect.c	25 Apr 2003 21:24:38 -0000	1.3
@@ -30,7 +30,7 @@
 	      IcImage	 *clipPict,
 	      IcColor	 *color,
 	      int	 nRect,
-	      xRectangle *rects,
+	      IcRectangle *rects,
 	      int	 xoff,
 	      int	 yoff)
 {
@@ -82,7 +82,7 @@
 		      unsigned int	width,
 		      unsigned int	height)
 {
-    XRectangle rect;
+    IcRectangle rect;
 
     rect.x = x;
     rect.y = y;
@@ -96,7 +96,7 @@
 IcFillRectangles (char			op,
 		  IcImage		*dst,
 		  const IcColor		*color,
-		  const XRectangle	*rects,
+		  const IcRectangle	*rects,
 		  int			nRects)
 {
     IcColor color_s = *color;

Index: ictrap.c
===================================================================
RCS file: /local/src/CVS/libic/src/ictrap.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ictrap.c	17 Apr 2003 15:48:22 -0000	1.5
+++ ictrap.c	25 Apr 2003 21:24:38 -0000	1.6
@@ -63,19 +63,19 @@
     return image;
 }
 
-static XFixed
-IcLineFixedX (const XLineFixed *l, XFixed y, Bool ceil)
+static IcFixed16_16
+IcLineFixedX (const IcLineFixed *l, IcFixed16_16 y, Bool ceil)
 {
-    XFixed	    dx = l->p2.x - l->p1.x;
+    IcFixed16_16    dx = l->p2.x - l->p1.x;
     xFixed_32_32    ex = (xFixed_32_32) (y - l->p1.y) * dx;
-    XFixed	    dy = l->p2.y - l->p1.y;
+    IcFixed16_16    dy = l->p2.y - l->p1.y;
     if (ceil)
 	ex += (dy - 1);
-    return l->p1.x + (XFixed) (ex / dy);
+    return l->p1.x + (IcFixed16_16) (ex / dy);
 }
 
 static void
-IcTrapezoidBounds (int ntrap, const XTrapezoid *traps, PixRegionBox *box)
+IcTrapezoidBounds (int ntrap, const IcTrapezoid *traps, PixRegionBox *box)
 {
     box->y1 = MAXSHORT;
     box->y2 = MINSHORT;
@@ -113,7 +113,7 @@
 		       IcImage		*dst,
 		       int		xSrc,
 		       int		ySrc,
-		       const XTrapezoid *traps,
+		       const IcTrapezoid *traps,
 		       int		ntraps)
 {
     IcImage		*image = NULL;
@@ -803,10 +803,11 @@
 }
 
 static void 
-pixelWalkInit (PixelWalk *pw, XLineFixed *line, XFixed top_y, XFixed bottom_y)
+pixelWalkInit (PixelWalk *pw, IcLineFixed *line,
+	       IcFixed16_16 top_y, IcFixed16_16 bottom_y)
 {
     xFixed_32_32    dy_inc, dx_inc;
-    XPointFixed	    *top, *bot;
+    IcPointFixed	    *top, *bot;
 
     /*
      * Orient lines top down
@@ -1138,11 +1139,11 @@
 
 void
 IcRasterizeTrapezoid (IcImage		*pMask,
-		      const XTrapezoid	*pTrap,
+		      const IcTrapezoid	*pTrap,
 		      int		x_off,
 		      int		y_off)
 {
-    XTrapezoid	trap = *pTrap;
+    IcTrapezoid	trap = *pTrap;
     int alpha, temp;
     
     IcCompositeOperand	mask;

Index: ictri.c
===================================================================
RCS file: /local/src/CVS/libic/src/ictri.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ictri.c	17 Apr 2003 15:48:22 -0000	1.4
+++ ictri.c	25 Apr 2003 21:24:38 -0000	1.5
@@ -26,12 +26,12 @@
 
 void
 IcRasterizeTriangle (IcImage		*image,
-		     const XTriangle	*tri,
+		     const IcTriangle	*tri,
 		     int		x_off,
 		     int		y_off);
 
 static void
-IcPointFixedBounds (int npoint, const XPointFixed *points, PixRegionBox *bounds)
+IcPointFixedBounds (int npoint, const IcPointFixed *points, PixRegionBox *bounds)
 {
     bounds->x1 = xFixedToInt (points->x);
     bounds->x2 = xFixedToInt (xFixedCeil (points->x));
@@ -59,19 +59,19 @@
 }
 
 static void
-IcTriangleBounds (int ntri, const XTriangle *tris, PixRegionBox *bounds)
+IcTriangleBounds (int ntri, const IcTriangle *tris, PixRegionBox *bounds)
 {
-    IcPointFixedBounds (ntri * 3, (XPointFixed *) tris, bounds);
+    IcPointFixedBounds (ntri * 3, (IcPointFixed *) tris, bounds);
 }
 
 void
 IcRasterizeTriangle (IcImage		*image,
-		     const XTriangle	*tri,
+		     const IcTriangle	*tri,
 		     int		x_off,
 		     int		y_off)
 {
-    const XPointFixed	*top, *left, *right, *t;
-    XTrapezoid		trap[2];
+    const IcPointFixed	*top, *left, *right, *t;
+    IcTrapezoid		trap[2];
 
     top = &tri->p1;
     left = &tri->p2;
@@ -148,7 +148,7 @@
 		      IcImage		*dst,
 		      int		xSrc,
 		      int		ySrc,
-		      const XTriangle	*tris,
+		      const IcTriangle	*tris,
 		      int		ntris)
 {
     PixRegionBox	bounds;
@@ -219,10 +219,10 @@
 		     IcImage		*dst,
 		     int		xSrc,
 		     int		ySrc,
-		     const XPointFixed	*points,
+		     const IcPointFixed	*points,
 		     int		npoints)
 {
-    XTriangle		tri;
+    IcTriangle		tri;
     PixRegionBox	bounds;
     IcImage		*image = NULL;
     int		xDst, yDst;
@@ -295,13 +295,13 @@
 		   IcImage		*dst,
 		   int			xSrc,
 		   int			ySrc,
-		   const XPointFixed	*points,
+		   const IcPointFixed	*points,
 		   int			npoints)
 {
-    XTriangle		tri;
+    IcTriangle		tri;
     PixRegionBox	bounds;
     IcImage		*image = NULL;
-    const XPointFixed	*first;
+    const IcPointFixed	*first;
     int		xDst, yDst;
     int		xRel, yRel;
     IcFormat	*format;