Exemple #1
0
func Draw(ind *node.Node, img *imgut.Image) {
	// We have to compile the nodes
	exec := node.CompileTree(ind).(*binary.Primitive)
	// Apply the function
	//	exec(0 0, float64(img.W), float64(img.H), img)
	var call imgut.PixelFunc = func(x, y float64) float64 {
		return float64(exec.Eval(binary.NumericIn(x), binary.NumericIn(y)))
	}
	img.FillMathBounds(call)
}