The Libart Library

Libart is a high-performance rendering library that provides a rich imaging model. Libart's imaging model is a superset of PostScript, and it adds support for antialiasing and alpha compositing (transparency). It is similar to ‘next-generation’ imaging models such as Adobe's Bravo, the Java 2D API, Adobe's Precision Graphics Markup Language (PGML), and the World Wide Web Consortium's Scalable Vector Graphics (SVG).

These are some of the data structures that Libart provides to applications.

Point. This is a simple 2D point specified as an ordered pair of coordinates.

Rectangle. A pair of points that define the opposite corners of a rectangle.

Vector path. A PostScript-like ordered list of operations and points that are used to define an open or closed path. Operations include moveto, lineto, and curveto.

Affine transformation matrix. An array of six numbers that define the values for a 3×3 transformation matrix. Depending on these values, the matrix can be used to scale, rotate, translate, or shear a point or a vector path.

Bézier path. Similar to a vector path, but each segment can be a Béezier curve specified by its control points.

Sorted vector path (SVP). A vector path that has been processed so that its segments are stored with monotonically-increasing Y coordinates. This allows for very efficient rasterization, since the segments are in top-to-bottom order.

Microtile array. A simple data structure to represent 2D regions, particularly the region of a window that needs repainting.

RGB and RGBA images. Color images with optional opacity information.

Some imaging operations provided by Libart include:

Performance

Libart uses several techniques to maximize performance. Microtile arrays allow the client application to efficiently compute and store the region that needs repainting. Sorted vector paths are an optimization for the vector rendering stage.