GaussDrawer

GaussDrawer

new GaussDrawer(points, weights)

Source:

The constructor of the class Graph.

Parameters:
Name Type Description
points Array.<Vector2>

The centres of the gaussians.

weights Array.<Number>

The weights / amplitudes for each gaussian.

Methods

draw()

Source:

Compute and draw the gaussians.

getImage(callback)

Source:

Get the canvas as an HTML image.

Parameters:
Name Type Description
callback CallableFunction

getSVG(callback)

Source:

Get the canvas as an SVG element.

Parameters:
Name Type Description
callback CallableFunction

setPixel(vec, r, g, b, a)

Source:

Set the colour at a specific point on the canvas.

Parameters:
Name Type Description
vec Vector2

The pixel position on the canvas.

r Number

The red colour-component.

g Number

The green colour-component.

b Number

The blue colour-component.

a Number

The alpha colour-component.