[Commit] cairo ChangeLog,1.66,1.67 TODO,1.7,1.8
Carl Worth
commit at keithp.com
Mon Sep 29 12:55:58 PDT 2003
- Previous message: [Commit] cairo/src cairo.c, 1.14, 1.15 cairo.h, 1.15,
1.16 cairo_font.c, 1.6, 1.7 cairo_gstate.c, 1.14,
1.15 cairoint.h, 1.21, 1.22
- Next message: [Commit] cairo/src cairo_surface.c,1.10,1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: cworth
Update of /local/src/CVS/cairo
In directory home.keithp.com:/tmp/cvs-serv8508
Modified Files:
ChangeLog TODO
Log Message:
Bugfix from Graydon Hoare.
Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/cairo/ChangeLog,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- ChangeLog 29 Sep 2003 15:36:29 -0000 1.66
+++ ChangeLog 29 Sep 2003 18:55:56 -0000 1.67
@@ -1,3 +1,11 @@
+2003-09-29 Carl Worth <cworth at east.isi.edu>
+
+ * TODO: Remove arc notes since arcs are done.
+
+ * src/cairo_surface.c (_cairo_surface_composite): Fix bug
+ (IcImageGetHeight instead of IcImageGetWidth) from Graydon Hoare
+ <graydon at redhat.com>.
+
2003-09-29 Carl Worth <cworth at isi.edu>
* configure.in (CAIRO_VERSION): Bumpred version to 0.1.6 to
Index: TODO
===================================================================
RCS file: /local/src/CVS/cairo/TODO,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- TODO 29 Sep 2003 15:36:29 -0000 1.7
+++ TODO 29 Sep 2003 18:55:56 -0000 1.8
@@ -2,8 +2,6 @@
* Implement text support for the image backend.
-* Add arc support.
-
* Re-implement pattern support with a more PostScript-like API.
* Virtualize the backend interface so that the various backends can be
@@ -11,88 +9,6 @@
* Verification, profiling, optimization.
-Some notes on arc support
-=========================
-
-Some general notions
---------------------
-This is from "Approximation of circular arcs by cubic poynomials",
-Michael Goldapp, Computer Aided Geometric Design 8 (1991) 227-238.
-
-To draw a unit arc from 0 to A with 0 < A < pi/2:
-
- Y
-
- | .
- | / .
- | / .
- |/A .
- +------.-- X
- 0 1
-
-The deviation in radius is given by:
-
- rho(t) = sqrt ( x^2(t) + y^2(t) ) - 1
-
-A simpler error function to work with is:
-
- e(t) = x^2(t) + y^2(t) - 1
-
-And from "Good approximation of circles by curvature-continuous Bezier
-curves", Tor Dokken and Morten Daehlen, Computer Aided Geometric
-Design 8 (1990) 22-41, we learn:
-
- e(t) ~ 2 abs( rho(t) )
-
-Continuing with Goldapp's analysis, a single cubic Bezier spline
-approximation must have the 4 control points:
-
- (1, 0)
- (1, h)
- (cos(A) + h * sin(A), sin(A) - h * cos(A))
- (cos(A), sin(A))
-
-Various approximations can be determined by selecting the value of
-h. A convenient value, (though not optimal in terms of error), is:
-
- h = 4/3 * tan(A/4)
-
-From which we can determine the maximum error:
-
- abs( max(e(t)) ) = 4/27 * (sin^6 (A/4)) / (cos^2 (A/4))
- t in [0,1]
-
------
-
-Now, for Cairo we want to draw an arc of radius R from an angle A to
-an angle B, (where B > A). So the equations above have trivial
-modifications:
-
-The spline control points become
-
- (R * cos(A), R * sin(A))
- (R * cos(A) - h * sin(A), R * sin(A) + h * cos (A))
- (R * cos(B) + h * sin(B), R * sin(B) - h * cos (B))
- (R * cos(B), R * sin(B))
-
-where h = 4/3 * R * tan ((B-A)/4)
-
-And the maximum deviation in radius is approximately:
-
- 2/27 * (sin^6 ((B-A)/4) / cos^2 ((B-A)/4))
-
-So now we can get down to writing some C code:
-
-double
-_arc_error_normalized (double angle)
-{
- return 2/27 * pow (sin (angle / 4), 6) / pow (cos (angle / 4), 2);
-}
-
-And for accurate drawing the following must hold in device space:
-
- tolerance/radius >= _arc_error_normalized (B-A)
-
A comparison with PostScript
============================
- Previous message: [Commit] cairo/src cairo.c, 1.14, 1.15 cairo.h, 1.15,
1.16 cairo_font.c, 1.6, 1.7 cairo_gstate.c, 1.14,
1.15 cairoint.h, 1.21, 1.22
- Next message: [Commit] cairo/src cairo_surface.c,1.10,1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commit
mailing list