C++ header-only library for 2D/3D computer graphics, image processing and mathematics (linear algebra and statistics).
Looking for examples? Go directly to the Examples page.
SpatiumLib has the following key points:
Applicability
- Header-only. No platform dependent library linking.
- Written in C++11.
- No dependencies except C++ Standard Library. QtTest for unit testing.
Education
- Code readability more important than optimizations.
- Documentation through comments in code.
- Doxygen documentation (read the docs).
- Examples on the Wiki (read the wiki).
Performance is not a key point of SpatiumLib. There is no GPU acceleration or multithreading. This may be quite important, especially for 3D graphics.
Looking for class references? Go directly to the Class References page.
SpatiumLib is a collection of header files (*.h) distributed over several directories. Each of these directories represents a namespace with identical name.
Global namespace including base Matrix, Vector and Image. Also contains mathematical functions.
#include <spatium/geom2d.h>
2D geometry namespace including class Vector2
#include <spatium/geom3d.h>
3D geometry namespace including classes Matrix4x4, Point3, Ellipsoid and more...
#include <spatium/gfx3d.h>
3D graphics namespace including classes Mesh, Camera, Scene, Renderer and more...
#include <spatium/gfx2d.h>
2D graphics namespace including draw functions for lines, circles, rectangles and Bezier curves.
#include <spatium/imgproc.h>
Image processing namespace including classes and functions for image convolution (thresholding, blurring, etc.) and feature extraction (corners, edges).
#include <spatium/idx.h>
Spatial indexing namespace including class Tree
#include <spatium/stats.h>
Statistics namespace with convenience function for computing mean, standard deviation, variance, covariance, etc.
- Clone or download this repository.
git clone https://github.com/martijnkoopman/SpatiumLib.git
- Copy directory
spatium
frominclude
into your project.
This directory has the following subdirectories, each being a namespace:
geom2d
geom3d
gfx2d
gfx3d
imgproc
idx
stats
- Include the required files.
For example: #include <spatium/Matrix.h>
You can include individual files (classes) or whole namespaces. You can also delete namespaces (directories) that you don't need as long as it isn't a dependecny for other namespaces you're using.
This library is licensed under the GNU General Public License 3.0 - see the LICENSE.md file for details.