if (do_name() != 'Home') : ?>
endif ?>
Posted by Keith O'Hara on Apr 23, 2009
include("util/comment.php"); ?>
Sorry about that, I missed the first few lines, this works:
coreimage = ximport("coreimage")
canvas = coreimage.canvas(150, 150)
def fractal(x, y, depth=64):
z = complex(x, y)
o = complex(0, 0)
for i in range(depth):
if abs(o) <= 2: o = o*o + z
else:
return i
return 0 #default, black
pixels = []
w = h = 150
for i in range(w):
for j in range(h):
v = fractal(float(i)/w, float(j)/h)
pixels.append(color(v/10.0, v/20.0, v/10.0))
l = canvas.append(pixels, w, h)
canvas.draw()
core image append() error
Posted by Keith O'Hara on Apr 23, 2009I'm trying to use the mandelbrot example from the docs:
coreimage = ximport("coreimage")
def fractal(x, y, depth=64):
z = complex(x, y)
o = complex(0, 0)
for i in range(depth):
if abs(o) <= 2: o = o*o + z
else:
return i
return 0 #default, black
pixels = []
w = h = 150
for i in range(w):
for j in range(h):
v = fractal(float(i)/w, float(j)/h)
pixels.append(color(v/10.0, v/20.0, v/10.0))
l = canvas.append(pixels, w, h)
But I get this error:
Traceback (most recent call last):
File "nodebox/gui/mac/__init__.pyo", line 358, in _execScript
File "", line 20, in
TypeError: append() takes exactly 2 arguments (4 given)