LibBoard: A vector graphics C++ library
(Exporting Postscript, SVG, and Fig files.)
The LibBoard C++ library
(Motivation for this piece of code) There are more people on this planet who are fluent in, or at least know as
beginners, the C++ language than there are people who know all together the Postscript, SVG, and FIG (XFig) file formats. Actually Postscript is also a programming language, but that's part of another story.
The next point is: how can one draw a vector graphic with his favorite drawing software when
this graphic involves a lot, say a huge amount of primitives, especially when the graphic
would be easy to build using loops, variables, functions. Eventually, one may enjoy being able
to code the drawing in C++ and then export it as an EPS file for inclusion in a LaTeX document, as an XFig file for further editing with Xfig, or as an SVG file that may be augmented/edited
with any SVG drawing tool.
New ! Starting with version 0.9.0, LibBoard is distributed under the term of the GNU Lesser General Public Licence.
For now, LibBoard can handle primitives like lines, rectangles, triangles, polylines, circles, ellipses and text.
In future releases, bitmap insertion should be supported.
See the TODO file for a list of features that should be added in future releases.
Sample programs using the LibBoard library
- The LibBoard logo
This program draws the LibBoard logo.
Source code: logo.cpp
Output files: logo_A4.svg, logo_A4.eps, or logo_A4.fig.
- Simple drawing with transparency
Drawing with several primitives. (Note that the transparency is handled only with SVG files.)
Source code: example2.cpp
Output files: draw2.svg, draw2.eps, or draw2.fig.
- Arithmetic coding illustration
Source code: arithmetic.cpp
Output files: arithm.svg, arithm.eps, or arithm.fig.
- A CImg example
A sample program distributed with the CImg library, which
uses LibBoard to achieve vector rendering of 3D primitives.
Source code: scene3d.cpp
Output files: output.svg, output.eps, and output.fig.
- Sourceforge download section
Click here to go to the
download section on the Sourceforge server.
- Latest development source code (version 0.9.0)
You may get the lastest source code from the Git repository with the command below:
git clone http://git.code.sf.net/p/libboard/source-code libboard