Module raster

Module raster 

Source

Structs§

Bitmap
A raw bitmap represented by width, height and RGBA data.

Functions§

bresenham
Returns all integer pixel coordinates along a straight line between a and b using Bresenham’s algorithm.
circle
Generates integer pixel coordinates within a circle with optional clipping.
ellipse
Returns pixel coordinates for an ellipse.
floodfill
Flood fills starting at pos with fill color.
fract
Returns the fractional part of a number.
gaussian
Gaussian weight with hardness controlling the falloff steepness.
noise
Computes a pseudo-random noise value for the given 2D coordinate.
pad
Pads a bitmap to the given [width, height] filling empty space with bg.
pascaltriangle
Binomial coefficient using generalized Pascal’s triangle.
rectangle
Generates all integer pixel coordinates contained within a rectangle.
resize
Resizes a bitmap to the specified [width, height].
scale
Scales a bitmap by [factor_x, factor_y] using nearest neighbour sampling.
smoothstep
Generalized smoothstep function of order n.
tile
Tiles a source bitmap to cover the given width and height.