libmypaint  1.6.1
libmypaint - the MyPaint brush library

Overview

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.

Brief History

Note
The focus of this timeline is development that relates to the parts of MyPaint development that ultimately became libmypaint. It is only a small fraction of the work that was undertaken over the covered time period.

Examples

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.