GCanvas and Grlib

GCanvas and Grlib are helper llibraries for 2D graphics.

GCanvas provides a consistent interface for direct in-memory rendering. It used to support a lot of canvas types, but only the most useful two stayed: GdkPixbuf-based canvas, and CairoCanvas. CairoCanvas is the most interesting option, since it allows to mix direct in-memory drawing with calls to Cairo drawing functions.

Grlib is a simple drawing library operating on in-memory pixel buffers. Grlib is meant to support a limited set of graphics primitives, which should be sufficient for a Wire EDM control program visualization. Supported drawing primitives include line segments, circular arcs, and ellipses. All lines are one pixel thick, can be drawn antialized, and are carefully culled according to the specified viewport.

The existence of GCanvas+Grlib pair allows for visualization of control programs in the absence of sufficiently fast OpenGL support, and integration with Cairo gives some unique opportunities for rich 2D visualization.

Last updated: 24th of March, 2007