7#include "../bitmap/rgba.h"
20class RotatedRectangle;
66std::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);
73std::vector<geometrize::Scanline>
scanlinesForPolygon(
const std::vector<std::pair<float, float>>& points);
75std::vector<geometrize::Scanline>
rasterize(
const geometrize::Shape& s, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax);
76std::vector<geometrize::Scanline>
rasterize(
const geometrize::Circle& s, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax);
77std::vector<geometrize::Scanline>
rasterize(
const geometrize::Ellipse& s, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax);
78std::vector<geometrize::Scanline>
rasterize(
const geometrize::Line& s, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax);
79std::vector<geometrize::Scanline>
rasterize(
const geometrize::Polyline& s, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax);
81std::vector<geometrize::Scanline>
rasterize(
const geometrize::Rectangle& s, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax);
84std::vector<geometrize::Scanline>
rasterize(
const geometrize::Triangle& s, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax);
92bool scanlinesOverlap(
const std::vector<geometrize::Scanline>& first,
const std::vector<geometrize::Scanline>& second);
100bool scanlinesContain(
const std::vector<geometrize::Scanline>& first,
const std::vector<geometrize::Scanline>& second);
105std::vector<std::pair<std::int32_t, std::int32_t>>
shapeToPixels(
const geometrize::Shape& shape, std::int32_t xMin, std::int32_t yMin, std::int32_t xMax, std::int32_t yMax);
The Bitmap class is a helper class for working with bitmap data.
Definition: bitmap.h:16
The Circle class represents a circle.
Definition: circle.h:16
The Ellipse class represents an ellipse.
Definition: ellipse.h:16
The Line class represents a simple line.
Definition: line.h:16
The Polyline class represents a polyline.
Definition: polyline.h:18
The QuadraticBezier class represents a quadratic bezier curve.
Definition: quadraticbezier.h:16
The Rectangle class represents a rectangle.
Definition: rectangle.h:16
The RotatedEllipse class represents a rotated ellipse.
Definition: rotatedellipse.h:16
The RotatedRectangle class represents a rotated rectangle.
Definition: rotatedrectangle.h:16
The Triangle class represents a triangle.
Definition: triangle.h:16
std::vector< std::pair< float, float > > getPointsOnRotatedEllipse(const geometrize::RotatedEllipse &e, const std::size_t numPoints)
getPointsOnRotatedEllipse Calculates and returns a number of points on the given rotated ellipse.
Definition: rasterizer.cpp:57
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)
Definition: rasterizer.cpp:430
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)
Definition: rasterizer.cpp:420
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)
Definition: rasterizer.cpp:194
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 sc...
Definition: rasterizer.cpp:399
std::vector< std::pair< float, float > > getCornerPoints(const geometrize::RotatedRectangle &r)
getCornerPoints Gets the corner points of the given rotated rectangle.
Definition: rasterizer.cpp:30
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.
Definition: rasterizer.cpp:166
void drawLines(geometrize::Bitmap &image, const geometrize::rgba color, const std::vector< geometrize::Scanline > &lines)
drawLines Draws scanlines onto an image.
Definition: rasterizer.cpp:74
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.
Definition: rasterizer.cpp:112
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
Definition: rasterizer.cpp:385
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)
Definition: rasterizer.cpp:425
std::vector< std::pair< std::int32_t, std::int32_t > > bresenham(std::int32_t x1, std::int32_t y1, const std::int32_t x2, const std::int32_t y2)
bresenham Bresenham's line algorithm. Returns the points on the line.
Definition: rasterizer.cpp:122
The rgba struct is a helper for manipulating RGBA8888 color data.
Definition: rgba.h:13