Re: [pyGEF-develop] Using enthought.kiva as rendering backend
Status: Pre-Alpha
Brought to you by:
hrgerber
|
From: <pyg...@li...> - 2007-08-03 23:43:41
|
pyg...@li... wrote:
> Hi there
>
> Just to let you know that we have one new member, Louis Jordaan.
> He is one of my students and will be doing his final year engineering
> project for the next five to six months. A large portion of his work is to
> make pyGEF usable
Great news -- I'm looking forward to the results!
> I have been looking at Kiva for the last day or so. Have any of you ever
> used it?
No
> Read about it?
Yes.
> As far as I could figure out it uses agg as a
> renderer/back-end.
Well, it's supposed to a multi-back-end thing, like many, but Agg is the
most-used one. I think the wx back-end for instance, renders with Agg,
then blits to wx -- like Matplotlib wxAgg.
It's modeled after DisplayPDF, so it should work with on OS-X, and I"d
think the PDF back-end would be pretty simple! Having a PDF option sure
would be nice.
> Which you have previously suggested agg.
That may have been me -- it does have very nice output, and it's
reported to be very fast.
> It looks like it's rendering is much, MUCH faster than using the GC directly
I'm getting more disappointed with GC's performance. But does it support
everything you need?
> 1. Can or should pyGEF use Kiva as its primary backend?
> 2. In the current version of pyGEF I use a Plotter class to draw my graphic
> objects. This Plotter Interface class (abstraction layer) allows for the use
> of multiple rendering back-ends. The problem is that an API for this Plotter
> Interface needs to be defined. I would appreciate suggestions, with special
> considerations for that fact that pyGEF must be usable as a base for a SVG
> type graphic drawing tool.
Have you seen any of Chris Mellon's work with a wxPython SVG renderer?
Search the wxPython mailing list for more info.
> I'm trying to teach +-480 first year students to program
yow! Using Python, I hope!
> Bill, I saw that enthought has a very basic affine transform module in kiva
> (all python),
Are you sure. I see this on the Wiki:
"""
AffineMatrix:
(kiva_affine_matrix.h and affine_matrix.i) All of the following member
functions modify the instance on which they are called:
* __init__(v0, v1, v2, v3, v4, v5) or __init__()
* reset() # sets this matrix to the identity
* multiply(AffineMatrix) # multiples this matrix by another
* invert() # sets this matrix to the inverse of itself
* flip_x() # mirrors around X
* flip_y() # mirrors around Y
* scale() -> float # returns the average scale of this matrix
* determinant() -> float # returns the determinant
The following factory methods are available in the top-level "agg"
namespace to create specific kinds of AffineMatrix instances:
* translation_matrix(float X, float Y)
* rotation_matrix(float angle_in_radians)
* scaling_matrix(float x_scale, float y_scale)
* skewing_matrix(float x_shear, float y_shear)
FontType
"""
This makes it look like there is a C/C++ implementation of some sort.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|