This section details the API for the construction of
user-visible data structure, namely: ArtVpath
and ArtBpath.
Details
struct ArtPoint
struct ArtPoint {
/*< public >*/
double x, y;
};
This structure is used here and there in the API: there is no general rule
about its use. It simply represents a point with its x and y coordinates
in the libart 2D space.
The libart 2D space is not a direct cartesian 2D space: it is an indirect cartesian
space (that is, its direction is the invert of the standard trigonometric direction).
The 2D space used by libart is inspired by the X coordinate space:
This enum contains the list of the possible drawing commands understood
by ArtVpath and ArtBpath.
These commands are described there.
They can be summarized by the folowing figure:
Figure 2. Drawing commands
ART_MOVETO
move to a given point, without drawing pixels.
ART_MOVETO_OPEN
move to a given point, without drawing pixels. Do not close the vector path at the end.
ART_CURVETO
move to a given point along a given bezier path while drawing pixels.
ART_LINETO
move to a given point along a staright line while drawing pixels.
A vector path is an array of ArtVpath (short for vector path) data structures.
Each of those describes a
given vector along the vector path. ArtVpaths can contain ART_MOVETO,
ART_MOVETO_OPEN, ART_LINETO and ART_END
commands. Of course, the x and y members of this data structure have no meaning when code is
ART_END.
A vector path can also be an array of ArtBpath (short for bézier path) data structures.
Bézier paths can hold all the possible drawing commands present in an ArtPathCode. XXX: is this true ?
Creates a vector path closely approximating the bezier path defined by
bez. The flatness argument controls the amount of subdivision. In
general, the resulting vpath deviates by at most flatness pixels
from the "ideal" path described by bez.