various software projects
"artefact-metadata-hxa7241-www": {
  "title": "C++ Library",
  "author": "Harrison Ainsworth",
  "date": "2007-12-28",
  "id": "urn:uuid:D1A3A27C-B126-4E7B-B73E-B4ACFD5A62B9",
  "type": "summary",
  "subtype": "text/html",
  "wordcount": 282,
  "hashsecure": "sha256:d2321fd616ac42a86da84e3e9314eb8adc6e3e8e5f60f48a61dd7c4d59e370e6",
  "location": "http://www.hxa.name/rendering/cpplibrary.html"

C++ Library

some quite reusable c++ code


A collection of quite reusable graphics-oriented C++ code. Fairly refined as individual parts, but the package as a whole is a bit casual.

Comprising 29 modules, and about 8500 lines. Mostly classes, but several functions too. Not all tests are included.




FpToInt Int-float conversion functions
Clamps Functions to clamp numerics between bounds
Bounded Scalar value within a restricted range
Float01 Float value between 0 and 1, open or closed interval
hxa7241vectorstd::vector storage manipulation functions
Array Simpler, compacter alternative to std::vector
RandomMwc1 Simple, fast, good random number generator, v1
RandomMwc2 Simple, fast, good random number generator, v2
LogFast Fast approximation to log
PowFast Fast approximation to pow

dependent on above:

Sheet A simple 2D dynamic array, suitable for images



ColorConstantsStandard and common color constants
Filters Some 2D radial filter functions
Polar Disk-square mapping, and coordinate conversion functions
HaltonSequenceHalton sequence, with optional jittering
SobolSequence One dimension of a sobol sequence (choice of 40)
Coord2 2D coordinate class template
Vector3f Yes, its the 3D vector class!
XyzE Greg Ward-Larson realpixel, for any float triplet

dependent on above:

ColorSpace Trichromatic color space, with conversions to/from XYZ
UnitVector3f Unitized 3D vector
Vector4f 4D vector of floats
Matrix3f 3D matrix of floats, with extra translation capability
Matrix4f 4D matrix of floats
Quaternion Unit quaternion
Spherahedron Make a sphere of triangles, in shared-vertex form



ppm IO for the nice-and-simple PPM file format
rgbe IO for the Radiance RGBE file format
quantizingConversions between integer and float [0,1] triplet images


🌊 hxa7241-cpp-library-1.zip zipped C++ source code (128 KB)