![]() |
Geometrize 1.0
C++ library for geometrizing images into geometric primitives
|
Namespaces | |
namespace | commonutil |
namespace | core |
namespace | exporter |
Classes | |
class | Bitmap |
The Bitmap class is a helper class for working with bitmap data. More... | |
class | Circle |
The Circle class represents a circle. More... | |
class | Ellipse |
The Ellipse class represents an ellipse. More... | |
class | ImageRunner |
The ImageRunner class is a helper class for creating a set of primitives from a source image. More... | |
class | ImageRunnerOptions |
The ImageRunnerOptions class encapsulates preferences/options that the image runner uses. More... | |
struct | ImageRunnerShapeBoundsOptions |
The ImageRunnerShapeBoundsOptions struct encapsulates options for where shapes may be drawn within the image. Defines a rectangle expressed as percentages (0-100%) of the target image dimensions. More... | |
class | Line |
The Line class represents a simple line. More... | |
class | Model |
The Model class is the model for the core optimization/fitting algorithm. More... | |
class | Polyline |
The Polyline class represents a polyline. More... | |
class | QuadraticBezier |
The QuadraticBezier class represents a quadratic bezier curve. More... | |
class | Rectangle |
The Rectangle class represents a rectangle. More... | |
struct | rgba |
The rgba struct is a helper for manipulating RGBA8888 color data. More... | |
class | RotatedEllipse |
The RotatedEllipse class represents a rotated ellipse. More... | |
class | RotatedRectangle |
The RotatedRectangle class represents a rotated rectangle. More... | |
class | Scanline |
The Scanline class represents a scanline, a row of pixels running across a bitmap. More... | |
class | Shape |
struct | ShapeResult |
The ShapeResult struct is a container for info about a shape added to the model. More... | |
class | State |
The State class relates a shape and related properties to a measure of how close it brings the working image to the target image. More... | |
class | Triangle |
The Triangle class represents a triangle. More... | |
Typedefs | |
using | ShapeAcceptancePreconditionFunction = std::function< bool(double lastScore, double newScore, const geometrize::Shape &shape, const std::vector< geometrize::Scanline > &lines, const geometrize::rgba &color, const geometrize::Bitmap &before, const geometrize::Bitmap &after, const geometrize::Bitmap &target)> |
ShapeAcceptancePreconditionFunction Type alias for a function that is used to decide whether or not to finally add a shape to the image. More... | |
Enumerations | |
enum | ShapeTypes : std::uint32_t { RECTANGLE = 1U , ROTATED_RECTANGLE = 2U , TRIANGLE = 4U , ELLIPSE = 8U , ROTATED_ELLIPSE = 16U , CIRCLE = 32U , LINE = 64U , QUADRATIC_BEZIER = 128U , POLYLINE = 256U , SHAPE_COUNT = 9U } |
The ShapeTypes enum specifies the types of shapes that can be used. These can be combined to produce images composed of multiple primitive types. More... | |
Functions | |
bool | operator== (const geometrize::rgba &lhs, const geometrize::rgba &rhs) |
bool | operator!= (const geometrize::rgba &lhs, const geometrize::rgba &rhs) |
std::vector< float > | getRawShapeData (const geometrize::Shape &s) |
std::vector< float > | getRawShapeData (const geometrize::Circle &s) |
std::vector< float > | getRawShapeData (const geometrize::Ellipse &s) |
std::vector< float > | getRawShapeData (const geometrize::Line &s) |
std::vector< float > | getRawShapeData (const geometrize::Polyline &s) |
std::vector< float > | getRawShapeData (const geometrize::QuadraticBezier &s) |
std::vector< float > | getRawShapeData (const geometrize::Rectangle &s) |
std::vector< float > | getRawShapeData (const geometrize::RotatedEllipse &s) |
std::vector< float > | getRawShapeData (const geometrize::RotatedRectangle &s) |
std::vector< float > | getRawShapeData (const geometrize::Triangle &s) |
std::vector< std::pair< float, float > > | getCornerPoints (const geometrize::RotatedRectangle &r) |
getCornerPoints Gets the corner points of the given rotated rectangle. More... | |
std::vector< std::pair< float, float > > | getPointsOnRotatedEllipse (const geometrize::RotatedEllipse &e, std::size_t numPoints) |
getPointsOnRotatedEllipse Calculates and returns a number of points on the given rotated ellipse. More... | |
void | drawLines (geometrize::Bitmap &image, geometrize::rgba color, const std::vector< geometrize::Scanline > &lines) |
drawLines Draws scanlines onto an image. More... | |
void | copyLines (geometrize::Bitmap &destination, const geometrize::Bitmap &source, const std::vector< geometrize::Scanline > &lines) |
copyLines Copies source pixels to a destination defined by a set of scanlines. More... | |
std::vector< std::pair< std::int32_t, std::int32_t > > | bresenham (std::int32_t x1, std::int32_t y1, std::int32_t x2, std::int32_t y2) |
bresenham Bresenham's line algorithm. Returns the points on the line. More... | |
std::vector< geometrize::Scanline > | scanlinesForPolygon (const std::vector< std::pair< float, float > > &points) |
scanlinesForPolygon Gets the scanlines for a series of points that make up an arbitrary polygon. More... | |
std::vector< geometrize::Scanline > | rasterize (const geometrize::Shape &s, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::Circle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::Ellipse &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::Line &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::Polyline &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::QuadraticBezier &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::Rectangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::RotatedEllipse &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::RotatedRectangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< geometrize::Scanline > | rasterize (const geometrize::Triangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
bool | scanlinesOverlap (const std::vector< geometrize::Scanline > &first, const std::vector< geometrize::Scanline > &second) |
scanlinesOverlap Returns true if any of the scanlines from the first vector overlap the second More... | |
bool | scanlinesContain (const std::vector< geometrize::Scanline > &first, const std::vector< geometrize::Scanline > &second) |
scanlinesContain Returns true if the first vector of scanlines wholly contain the second vector of scanlines. More... | |
bool | shapesOverlap (const geometrize::Shape &a, const geometrize::Shape &b, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
bool | shapeContains (const geometrize::Shape &container, const geometrize::Shape &containee, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
std::vector< std::pair< std::int32_t, std::int32_t > > | shapeToPixels (const geometrize::Shape &shape, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
bool | operator== (const geometrize::Scanline &lhs, const geometrize::Scanline &rhs) |
bool | operator!= (const geometrize::Scanline &lhs, const geometrize::Scanline &rhs) |
std::vector< geometrize::Scanline > | trimScanlines (const std::vector< geometrize::Scanline > &scanlines, std::int32_t minX, std::int32_t minY, std::int32_t maxX, std::int32_t maxY) |
trimScanlines Crops the scanning width of an array of scanlines so they do not scan outside of the given area. More... | |
std::function< std::shared_ptr< geometrize::Shape >()> | createDefaultShapeCreator (geometrize::ShapeTypes types, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax) |
createDefaultShapeCreator Creates an instance of the default shape creator object. The setup, mutate and rasterize methods are bound with default methods. More... | |
std::shared_ptr< geometrize::Shape > | create (geometrize::ShapeTypes t) |
create Creates a new shape of the specified type. More... | |
std::shared_ptr< geometrize::Shape > | randomShape () |
randomShape Creates a random shape. More... | |
std::shared_ptr< geometrize::Shape > | randomShapeOf (geometrize::ShapeTypes t) |
randomShapeOf Creates a random shape from the types supplied. More... | |
void | setup (geometrize::Shape &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::Circle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::Ellipse &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::Line &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::Polyline &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::QuadraticBezier &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::Rectangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::RotatedEllipse &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::RotatedRectangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | setup (geometrize::Triangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::Shape &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::Circle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::Ellipse &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::Line &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::Polyline &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::QuadraticBezier &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::Rectangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::RotatedEllipse &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::RotatedRectangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | mutate (geometrize::Triangle &s, const std::int32_t xMin, const std::int32_t yMin, const std::int32_t xMax, const std::int32_t yMax) |
void | translate (geometrize::Shape &s, const float x, const float y) |
void | translate (geometrize::Circle &s, const float x, const float y) |
void | translate (geometrize::Ellipse &s, const float x, const float y) |
void | translate (geometrize::Line &s, const float x, const float y) |
void | translate (geometrize::Polyline &s, const float x, const float y) |
void | translate (geometrize::QuadraticBezier &s, const float x, const float y) |
void | translate (geometrize::Rectangle &s, const float x, const float y) |
void | translate (geometrize::RotatedEllipse &s, const float x, const float y) |
void | translate (geometrize::RotatedRectangle &s, const float x, const float y) |
void | translate (geometrize::Triangle &s, const float x, const float y) |
void | scale (geometrize::Shape &s, const float scaleFactor) |
void | scale (geometrize::Circle &s, const float scaleFactor) |
void | scale (geometrize::Ellipse &s, const float scaleFactor) |
void | scale (geometrize::Line &s, const float scaleFactor) |
void | scale (geometrize::Polyline &s, const float scaleFactor) |
void | scale (geometrize::QuadraticBezier &s, const float scaleFactor) |
void | scale (geometrize::Rectangle &s, const float scaleFactor) |
void | scale (geometrize::RotatedEllipse &s, const float scaleFactor) |
void | scale (geometrize::RotatedRectangle &s, const float scaleFactor) |
void | scale (geometrize::Triangle &s, const float scaleFactor) |
void | rotate (geometrize::Shape &s, const float angle) |
void | rotate (geometrize::Line &s, const float angle) |
void | rotate (geometrize::RotatedEllipse &s, const float angle) |
void | rotate (geometrize::RotatedRectangle &s, const float angle) |
void | rotate (geometrize::Triangle &s, const float angle) |
Variables | |
const std::array< ShapeTypes, static_cast< std::size_t >(ShapeTypes::SHAPE_COUNT)> | allShapes |
allShapes is a convenient array of all of the members of ShapeTypes. More... | |
const std::vector< std::pair< ShapeTypes, std::string > > | shapeTypeNames |
shapeTypeNames provides a convenient mapping to names of types of shape (all lower case, underscores instead of spaces e.g. rotated_ellipse). More... | |
using geometrize::ShapeAcceptancePreconditionFunction = typedef std::function<bool( double lastScore, double newScore, const geometrize::Shape& shape, const std::vector<geometrize::Scanline>& lines, const geometrize::rgba& color, const geometrize::Bitmap& before, const geometrize::Bitmap& after, const geometrize::Bitmap& target)> |
ShapeAcceptancePreconditionFunction Type alias for a function that is used to decide whether or not to finally add a shape to the image.
lastScore | The image similarity score prior to adding the shape |
newScore | What the image similarity score would be after adding the shape |
shape | The shape that this function shall decide whether to add |
lines | The scanlines for the pixels in the shape |
color | The colour of the shape |
before | The image prior to adding the shape |
after | The image as it would be after adding the shape |
target | The image that we are trying to replicate |
enum geometrize::ShapeTypes : std::uint32_t |
The ShapeTypes enum specifies the types of shapes that can be used. These can be combined to produce images composed of multiple primitive types.
Enumerator | |
---|---|
RECTANGLE | |
ROTATED_RECTANGLE | |
TRIANGLE | |
ELLIPSE | |
ROTATED_ELLIPSE | |
CIRCLE | |
LINE | |
QUADRATIC_BEZIER | |
POLYLINE | |
SHAPE_COUNT |
std::vector< std::pair< std::int32_t, std::int32_t > > geometrize::bresenham | ( | std::int32_t | x1, |
std::int32_t | y1, | ||
std::int32_t | x2, | ||
std::int32_t | y2 | ||
) |
bresenham Bresenham's line algorithm. Returns the points on the line.
x1 | The start x-coordinate. |
y1 | The start y-coordinate. |
x2 | The end x-coordinate. |
y2 | The end y-coordinate. |
void geometrize::copyLines | ( | geometrize::Bitmap & | destination, |
const geometrize::Bitmap & | source, | ||
const std::vector< geometrize::Scanline > & | lines | ||
) |
copyLines Copies source pixels to a destination defined by a set of scanlines.
destination | The destination bitmap to copy the lines to. |
source | The source bitmap to copy the lines from. |
lines | The scanlines that comprise the source to destination copying mask. |
std::shared_ptr< geometrize::Shape > geometrize::create | ( | geometrize::ShapeTypes | t | ) |
create Creates a new shape of the specified type.
t | The type of shape to create. |
std::function< std::shared_ptr< geometrize::Shape >()> geometrize::createDefaultShapeCreator | ( | geometrize::ShapeTypes | types, |
std::int32_t | xMin, | ||
std::int32_t | yMin, | ||
std::int32_t | xMax, | ||
std::int32_t | yMax | ||
) |
createDefaultShapeCreator Creates an instance of the default shape creator object. The setup, mutate and rasterize methods are bound with default methods.
types | The types of shapes to create. |
xMin | The minimum x coordinate of the shapes created. |
yMin | The minimum y coordinate of the shapes created. |
xMax | The maximum x coordinate of the shapes created. |
yMax | The maximum y coordinate of the shapes created. |
void geometrize::drawLines | ( | geometrize::Bitmap & | image, |
geometrize::rgba | color, | ||
const std::vector< geometrize::Scanline > & | lines | ||
) |
drawLines Draws scanlines onto an image.
image | The image to be drawn to. |
color | The color of the scanlines. |
lines | The scanlines to draw. |
std::vector< std::pair< float, float > > geometrize::getCornerPoints | ( | const geometrize::RotatedRectangle & | r | ) |
getCornerPoints Gets the corner points of the given rotated rectangle.
r | The rotated rectangle. |
std::vector< std::pair< float, float > > geometrize::getPointsOnRotatedEllipse | ( | const geometrize::RotatedEllipse & | e, |
std::size_t | numPoints | ||
) |
getPointsOnRotatedEllipse Calculates and returns a number of points on the given rotated ellipse.
e | The rotated ellipse. |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::Circle & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::Ellipse & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::Line & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::Polyline & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::QuadraticBezier & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::Rectangle & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::RotatedEllipse & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::RotatedRectangle & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::Shape & | s | ) |
std::vector< float > geometrize::getRawShapeData | ( | const geometrize::Triangle & | s | ) |
void geometrize::mutate | ( | geometrize::Circle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::Ellipse & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::Line & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::Polyline & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::QuadraticBezier & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::Rectangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::RotatedEllipse & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::RotatedRectangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::Shape & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::mutate | ( | geometrize::Triangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
bool geometrize::operator!= | ( | const geometrize::rgba & | lhs, |
const geometrize::rgba & | rhs | ||
) |
bool geometrize::operator!= | ( | const geometrize::Scanline & | lhs, |
const geometrize::Scanline & | rhs | ||
) |
bool geometrize::operator== | ( | const geometrize::rgba & | lhs, |
const geometrize::rgba & | rhs | ||
) |
bool geometrize::operator== | ( | const geometrize::Scanline & | lhs, |
const geometrize::Scanline & | rhs | ||
) |
std::shared_ptr< geometrize::Shape > geometrize::randomShape | ( | ) |
randomShape Creates a random shape.
std::shared_ptr< geometrize::Shape > geometrize::randomShapeOf | ( | geometrize::ShapeTypes | t | ) |
randomShapeOf Creates a random shape from the types supplied.
t | The types of shape to possibly create. |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::Circle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::Ellipse & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::Line & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::Polyline & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::QuadraticBezier & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::Rectangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::RotatedEllipse & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::RotatedRectangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::Shape & | s, |
std::int32_t | xMin, | ||
std::int32_t | yMin, | ||
std::int32_t | xMax, | ||
std::int32_t | yMax | ||
) |
std::vector< geometrize::Scanline > geometrize::rasterize | ( | const geometrize::Triangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::rotate | ( | geometrize::Line & | s, |
const float | angle | ||
) |
void geometrize::rotate | ( | geometrize::RotatedEllipse & | s, |
const float | angle | ||
) |
void geometrize::rotate | ( | geometrize::RotatedRectangle & | s, |
const float | angle | ||
) |
void geometrize::rotate | ( | geometrize::Shape & | s, |
const float | angle | ||
) |
void geometrize::rotate | ( | geometrize::Triangle & | s, |
const float | angle | ||
) |
void geometrize::scale | ( | geometrize::Circle & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::Ellipse & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::Line & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::Polyline & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::QuadraticBezier & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::Rectangle & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::RotatedEllipse & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::RotatedRectangle & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::Shape & | s, |
const float | scaleFactor | ||
) |
void geometrize::scale | ( | geometrize::Triangle & | s, |
const float | scaleFactor | ||
) |
bool geometrize::scanlinesContain | ( | const std::vector< geometrize::Scanline > & | first, |
const std::vector< geometrize::Scanline > & | second | ||
) |
scanlinesContain Returns true if the first vector of scanlines wholly contain the second vector of scanlines.
first | First collection of scanlines. |
second | Second collection of scanlines. |
std::vector< geometrize::Scanline > geometrize::scanlinesForPolygon | ( | const std::vector< std::pair< float, float > > & | points | ) |
scanlinesForPolygon Gets the scanlines for a series of points that make up an arbitrary polygon.
points | The vertices of the polygon. |
bool geometrize::scanlinesOverlap | ( | const std::vector< geometrize::Scanline > & | first, |
const std::vector< geometrize::Scanline > & | second | ||
) |
scanlinesOverlap Returns true if any of the scanlines from the first vector overlap the second
first | First collection of scanlines. |
second | Second collection of scanlines. |
void geometrize::setup | ( | geometrize::Circle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::Ellipse & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::Line & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::Polyline & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::QuadraticBezier & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::Rectangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::RotatedEllipse & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::RotatedRectangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::Shape & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::setup | ( | geometrize::Triangle & | s, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
bool geometrize::shapeContains | ( | const geometrize::Shape & | container, |
const geometrize::Shape & | containee, | ||
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
bool geometrize::shapesOverlap | ( | const geometrize::Shape & | a, |
const geometrize::Shape & | b, | ||
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
std::vector< std::pair< std::int32_t, std::int32_t > > geometrize::shapeToPixels | ( | const geometrize::Shape & | shape, |
const std::int32_t | xMin, | ||
const std::int32_t | yMin, | ||
const std::int32_t | xMax, | ||
const std::int32_t | yMax | ||
) |
void geometrize::translate | ( | geometrize::Circle & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::Ellipse & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::Line & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::Polyline & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::QuadraticBezier & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::Rectangle & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::RotatedEllipse & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::RotatedRectangle & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::Shape & | s, |
const float | x, | ||
const float | y | ||
) |
void geometrize::translate | ( | geometrize::Triangle & | s, |
const float | x, | ||
const float | y | ||
) |
std::vector< geometrize::Scanline > geometrize::trimScanlines | ( | const std::vector< geometrize::Scanline > & | scanlines, |
std::int32_t | minX, | ||
std::int32_t | minY, | ||
std::int32_t | maxX, | ||
std::int32_t | maxY | ||
) |
trimScanlines Crops the scanning width of an array of scanlines so they do not scan outside of the given area.
scanlines | The scanlines to crop. |
minX | The minimum x value to crop to. |
minY | The minimum y value to crop to. |
maxX | The maximum x value to crop to. |
maxY | The maximum y value to crop to. |
const std::array< ShapeTypes, static_cast< std::size_t >(ShapeTypes::SHAPE_COUNT)> geometrize::allShapes |
allShapes is a convenient array of all of the members of ShapeTypes.
const std::vector< std::pair< ShapeTypes, std::string > > geometrize::shapeTypeNames |
shapeTypeNames provides a convenient mapping to names of types of shape (all lower case, underscores instead of spaces e.g. rotated_ellipse).