Commit bd71f98c authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add a bit of documentation

parent 33abd098
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -41,6 +41,26 @@

namespace plotfx {

/**
 * The layer is the central rendering context on which 2D vector graphics
 * operations, such as rendering text and drawing polygons, take place.
 *
 * The Layer struct itself is an abstract, transparent handle. It consists mostly
 * of function pointers that have to be bound to some specific rendering backend
 * for the Layer to be useful.
 *
 * Users should create layers using one of the layer_bind_* methods, for example
 * `layer_bind_png` or `layer_bind_svg`.
 *
 * Since the layer is a low-level interface, it is recommended that you use one
 * of the many drawing helper functions, such as `strokePath` or `drawText`, instead
 * of interacting directly with the Layer. Nevertheless, all supported drawing
 * operation are available through the `apply` method of the layer. Please refer
 * to `layer_op.h` for more information on the low-level operations API.
 *
 * Once you are done with all drawing calls, you can retrieve the result image by
 * calling the `data` function.
 */
struct Layer {
  const double width;
  const double height;