14struct ImageRunnerShapeBoundsOptions;
36std::int32_t
randomRange(std::int32_t min, std::int32_t max);
45template<
typename T> T
clamp(
const T& value,
const T& lower,
const T& upper)
47 return (std::max)(lower, (std::min)(value, upper));
The Bitmap class is a helper class for working with bitmap data.
Definition: bitmap.h:16
std::int32_t randomRange(const std::int32_t min, const std::int32_t max)
randomRange Returns a random integer in the range, inclusive. Uses thread-local random number generat...
Definition: commonutil.cpp:29
void seedRandomGenerator(const std::uint32_t seed)
seedRandomGenerator Seeds the (thread-local) random number generators.
Definition: commonutil.cpp:24
T clamp(const T &value, const T &lower, const T &upper)
clamp Clamps a value within a range.
Definition: commonutil.h:45
geometrize::rgba getAverageImageColor(const geometrize::Bitmap &image)
getAverageImageColor Computes the average RGB color of the pixels in the bitmap.
Definition: commonutil.cpp:35
bool scanlinesContainTransparentPixels(const std::vector< geometrize::Scanline > &scanlines, const geometrize::Bitmap &image, int minAlpha)
scanlinesContainTransparentPixels Returns true if the scanlines contain transparent pixels in the giv...
Definition: commonutil.cpp:62
std::tuple< std::int32_t, std::int32_t, std::int32_t, std::int32_t > mapShapeBoundsToImage(const geometrize::ImageRunnerShapeBoundsOptions &options, const geometrize::Bitmap &image)
mapShapeBoundsToImage Maps the given shape bound percentages to the given image, returning a bounding...
Definition: commonutil.cpp:75
The ImageRunnerShapeBoundsOptions struct encapsulates options for where shapes may be drawn within th...
Definition: imagerunneroptions.h:15
The rgba struct is a helper for manipulating RGBA8888 color data.
Definition: rgba.h:13