|
libmypaint
1.6.0
|
libmypaint, a.k.a. "the brush library" or "brushlib", provides a set of structures and interfaces allowing applications to use MyPaint brushes to draw strokes on surfaces.
See the data structures list for a context-free overview of the functionality provided. The most relevant structures (with associated functions) are:
MyPaintSurface, MyPaintBrush, and MyPaintTiledSurface
MyPaintSurface is an abstract interface providing the essential calls used by the brush engine, which is made up of the MyPaintBrush struct and its associated functions (or methods, if you like).
Having MyPaintSurface be abstract does in theory allow users of the library to provide their own surface implementations, but in order to be visually conformant with MyPaint, they need to use the same (or very similar) dab drawing and blending routines that are used by MyPaintTiledSurface, requiring them to either derive their own surface from MyPaintTiledSurface, or copy the relevant internal functions from the libmypaint source code.
libmypaint started out as a part of the MyPaint drawing program. Over time the code was gradually separated from the rest of the application, and eventually split out into a separate library. This evolution from an origin in application-specific code, as opposed to a design intended to be used as an independent library, is the reason why a lot of the code is structured the way it is.custom setting & input were added, as well as speed_log, speed_sqrt and opaque_linearize. The color_saturation setting was removed.smudge_length and tracking_noise.eraser setting was added. At the end of 2008, the core drawing code was split off into the "brushlib". Moved a lot of code from C to C++.smudge_radius_log setting was added, as well as the tilt_declination and tilt_ascension inputs.lock_alpha and colorize settings were added.libmypaint, with general dependency cleanup. The brushlib was converted (back) to C, from C++.1.3.0. 1.4.0 was released, not including the new features.1.5.0 was released.There is a minimal example in the examples folder in the source root, but for now the best way to learn how the structures and functions can be used is to look at the MyPaint source code. Searching for the string mypaint_ in the C/C++ files in the MyPaint source will yield all calls to libmypaint, providing useful entry points for further exploration.