Skip to content

Common Utilities

The headers common.h and colors.h include a number of utilities we use in our examples. These include naive functions to:

  • generate and manipulate vectors and strings;
  • handle RGBA color arrays;
  • convert points to and from polar coordinates;
  • read files to strings;
  • write strings to files;
  • calculate gradients;
  • read, write, and manipulate images;
  • and generate vectors with random numbers.

Although some of these functions might be helpful, most functions only operate on std::vector<double> and they are not intended to be a library of utilities. The sole purpose of these algorithms is to simplify the examples.