示例#1
0
文件: helpers.go 项目: akiross/gogp
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)
}
示例#2
0
文件: helpers.go 项目: akiross/gogp
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)
}
示例#3
0
文件: helpers.go 项目: akiross/gogp
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)
}