Geometrize  1.0
C++ library for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Namespaces | Functions | Variables
commonutil.cpp File Reference
#include "commonutil.h"
#include <assert.h>
#include <cstdint>
#include <random>
#include "bitmap/bitmap.h"
#include "bitmap/rgba.h"

Namespaces

 geometrize
 
 geometrize::commonutil
 

Functions

static thread_local std::mt19937 geometrize::commonutil::mt (std::random_device{}())
 
void geometrize::commonutil::seedRandomGenerator (std::uint32_t seed)
 seedRandomGenerator Seeds the (thread-local) random number generators. More...
 
std::int32_t geometrize::commonutil::randomRange (std::int32_t min, std::int32_t max)
 randomRange Returns a random integer in the range, inclusive. Uses thread-local random number generators under the hood. To ensure deterministic shape generation that can be repeated for different seeds, this should be used for shape mutation, but nothing else. More...
 
geometrize::rgba geometrize::commonutil::getAverageImageColor (const geometrize::Bitmap &image)
 getAverageImageColor Computes the average RGB color of the pixels in the bitmap. More...
 

Variables

static thread_local
std::uniform_int_distribution
< std::int32_t > 
geometrize::commonutil::pick