Status & Roadmap
Authors & License
Funding U++
Search on this site

SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord Logo



class DDARasterizer

Simple non-antialiased rasterizer capable of drawing lines with DDA algorithm and polygons with even-odd rule. Result is rendered to pure virtual methods that draw horizontal and vertical line segments.


Public Method List


virtual void PutHorz(int x, int y, int cx) = 0

Pure virtual method expected to paint horizontal line at x, y with length cx.



virtual void PutVert(int x, int y, int cy) = 0

Pure virtual method expected to paint horizontal line at x, y with length cy.



DDARasterizer& Move(Point p)

Moves the starting point of the next line to p. This point is also stored as path starting point so that it can be used in Close method.



DDARasterizer& Line(Point p)

If rasterizer is in line drawing mode, draws line from starting point to p. p becomes a new starting point. Final point of line is not drawn. Line thickness can be affected by Width method. If rasterizer is in polygin drawing mode (started by Polygon), adds the line to polygon path instead.



DDARasterizer& Close()

Draws line from starting point to the path starting point defined by Move.



DDARasterizer& Polygon()

Starts a polygon mode.



DDARasterizer& Fill()

Finishes polygon and fills it.



DDARasterizer& Ellipse(const Rect& rect)

Renders ellipse as serie of Move/Line commands.



DDARasterizer& Width(int width)

Sets the line thickness to width .



void Cy(int cy)

Sets the total height of painting area. Rasterizer only emits PutHorz/PutVert with y >= 0 and y < cy.


Do you want to contribute?