Exemplo n.º 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)
}
Exemplo n.º 2
0
func Draw(ind *node.Node, img *imgut.Image) {
	// We have to compile the nodes
	exec := node.CompileTree(ind).(vhs.Terminal)
	// Apply the function
	exec(0, 0, float64(img.W), float64(img.H), img)
}
Exemplo n.º 3
0
func Draw(ind *node.Node, img *imgut.Image) {
	// We have to compile the nodes
	renderer := node.CompileTree(ind).(*rr.Primitive)
	// Apply the function
	renderer.Render(0, 0, float64(img.W), float64(img.H), img)
}