Rasterization helper functions.

Static methods

staticbresenham (x1:Int, y1:Int, x2:Int, y2:Int):Array<Point>

Bresenham's line algorithm, returns the points on the line x1,y1 to x2,y2

Parameters:

x1

x-coordinate of the first point.

y1

y-coordinate of the first point.

x2

x-coordinate of the second point.

y2

y-coordinate of the second point.

Returns:

The points on the line x1,y1 to x2,y2

staticcopyLines (destination:Bitmap, source:Bitmap, lines:Array<Scanline>):Void

Copies source pixels to a destination defined by a set of scanlines.

Parameters:

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.

staticdrawLines (image:Bitmap, c:Rgba, lines:Array<Scanline>):Void

Draws scanlines onto an image.

Parameters:

image

The image to be drawn to.

color

The color of the scanlines.

lines

The scanlines to draw.

staticscanlinesForPolygon (points:Array<Point>):Array<Scanline>

Converts a polygon to a set of rasterizable scanlines.

Parameters:

points

The vertices of the polygon.

Returns:

Scanlines for the polygon.