KrisLibrary
1.0.0
|
A base class that allows rasterizing of 2D triangles into a grid. More...
#include <Rasterize.h>
Public Member Functions | |
void | Rasterize (const Triangle2D &t) |
void | ClippedRasterize (const Triangle2D &t, const AABB2D &aabb) |
void | Rasterize (const AABB2D &b) |
void | ClippedRasterize (const AABB2D &t, const AABB2D &aabb) |
void | Rasterize (const Triangle2D &t, const Vector3 &baryA, const Vector3 &baryB, const Vector3 &baryC) |
void | RasterizeVerticalSegment (int i, Real y1, Real y2, const Vector3 &baryA, const Vector3 &baryB) |
virtual void | VisitCell (const Vector3 ¶ms, int i, int j)=0 |
A base class that allows rasterizing of 2D triangles into a grid.
The triangle is assumed to be already in grid coordinates. Each cell (i,j) is filled if the point (i,j) is contained within the triangle. More precisely, it is filled if (i+eps,j+eps) is contained within the triangle for an infinitesmal perturbation eps.
The triangle is drawn no matter what its orientation (ccw or cw).
VisitCell() is an abstract method that should be overloaded by subclassing.