Anti grain geometry

I found an interesting 2d open source vector graphics c++ library called Anti grain Geometry.
It’s very fast and gives really high quality results for both vectors and images.

the link: http://www.antigrain.com

It’s completely cross platform and it’s quite similar to Java2D. I was wondering if there’s a java wrapper for it.

Some features (from the author):

* Anti-Aliasing.
* Subpixel Accuracy.
* The highest possible quality.
* High performance.
* Platform independence and compatibility.
* Flexibility and extensibility.
* Lightweight design.
* Reliability and stability (including numerical stability).

Below there are some key features (but not all of them):

* Rendering of arbitrary polygons with Anti-Aliasing and Subpixel Accuracy.
* Gradients and Gouraud Shading.
* Fast filtered image affine transformations, including many interpolation filters (bilinear, bicubic, spline16, spline36, sinc, Blackman).
* Strokes with different types of line joins and line caps.
* Dashed line generator.
* Markers, such as arrowheads/arrowtails.
* Fast vectorial polygon clipping to a rectangle.
* Low-level clipping to multiple rectangular regions.
* Alpha-Masking.
* A new, fast Anti-Alias line algorithm.
* Using arbitrary images as line patterns.
* Rendering in separate color channels.
* Perspective and bilinear transformations of vector and image data.
* Boolean polygon operations (and, or, xor, sub) based on Alan Murta's
  General Polygon Clipper.

Mik

I agree that in terms of features, speed and results agg is very interesting, but have you looked at the API yet?
I’d judge myself to be a not really bad c++ programmer, but code like that makes me scared:


agg::conv_transform<agg::path_storage> trans_gb_poly(gb_poly, mtx1);
agg::conv_transform<agg::path_storage> trans_arrows(arrows, mtx2);

ras2.add_path(trans_gb_poly);
ren.color(agg::rgba(0.5, 0.5, 0, 0.1));
agg::render_scanlines(ras2, sl, ren);

                agg::conv_stroke<agg::conv_transform<agg::path_storage> > stroke_gb_poly(trans_gb_poly);
stroke_gb_poly.width(0.1);

I though I’d give myself 5 hours to get a small example running, something that took my 20 minutes with Java2D, 1 hour with Cairo and with QT4, but I gave up half finished when it came to agg.

Apart from that it seems as if agg was very strongly tied to software rendering and would not easily allow hardware rendering - I’m not sure whether that is the right way, both since hardware may offer a great speed benefit and because an API (like Java2D or Cairo) can be design with an abstraction level to allow soft- and hardware rendering.

Yes, the API… of course you’re right!

That’s why I’m looking for a Java wrapper ;D

About hw acceleration, AGG can have pluggable rasterizers (ask John Meyer (Agile2D) why he’s so disappointed with the Java2D team), so I guess it wouldn’t be impossible to write an OpenGL implementation. Anyway AGG is a quality-oriented package, so I guess that speed is not a primary goal of its implementor.