Geometrize  1.0 C++ library for geometrizing images into geometric primitives
rasterizer.cpp File Reference
`#include "rasterizer.h"`
`#include <algorithm>`
`#include <cassert>`
`#include <cmath>`
`#include <cstdint>`
`#include <cstdlib>`
`#include <map>`
`#include <set>`
`#include <utility>`
`#include <vector>`
`#include "../commonutil.h"`
`#include "../bitmap/bitmap.h"`
`#include "../bitmap/rgba.h"`
`#include "../shape/circle.h"`
`#include "../shape/ellipse.h"`
`#include "../shape/line.h"`
`#include "../shape/polyline.h"`
`#include "../shape/quadraticbezier.h"`
`#include "../shape/rectangle.h"`
`#include "../shape/rotatedellipse.h"`
`#include "../shape/rotatedrectangle.h"`
`#include "../shape/triangle.h"`
`#include "scanline.h"`

geometrize

## Functions

std::vector< std::pair< float,
float > >
geometrize::getCornerPoints (const geometrize::RotatedRectangle &r)
getCornerPoints Gets the corner points of the given rotated rectangle. More...

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. More...

void geometrize::drawLines (geometrize::Bitmap &image, geometrize::rgba color, const std::vector< geometrize::Scanline > &lines)
drawLines Draws scanlines onto an image. More...

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. More...

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. More...

std::vector< geometrize::Scanlinegeometrize::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::Scanlinegeometrize::rasterize (const geometrize::Shape &s, std::int32_t xBound, std::int32_t yBound)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::Circle &s, const std::int32_t xBound, const std::int32_t yBound)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::Ellipse &s, const std::int32_t w, const std::int32_t h)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::Line &s, const std::int32_t xBound, const std::int32_t yBound)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::Polyline &s, const std::int32_t xBound, const std::int32_t yBound)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::QuadraticBezier &s, const std::int32_t xBound, const std::int32_t yBound)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::Rectangle &s, const std::int32_t xBound, const std::int32_t yBound)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::RotatedEllipse &s, const std::int32_t xBound, const std::int32_t yBound)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::RotatedRectangle &s, const std::int32_t xBound, const std::int32_t yBound)

std::vector< geometrize::Scanlinegeometrize::rasterize (const geometrize::Triangle &s, const std::int32_t xBound, const std::int32_t yBound)

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 More...

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. More...

bool geometrize::shapesOverlap (const geometrize::Shape &a, const geometrize::Shape &b, const std::int32_t xBound, const std::int32_t yBound)

bool geometrize::shapeContains (const geometrize::Shape &container, const geometrize::Shape &containee, const std::int32_t xBound, const std::int32_t yBound)

std::vector< std::pair
< std::int32_t, std::int32_t > >
geometrize::shapeToPixels (const geometrize::Shape &shape, const std::uint32_t xBound, const std::uint32_t yBound)