我在使用 smoot 着色算法时遇到问题。我只是没有在我的代码中实现它们。这是在一些计算的像素行之后导致错误的主要代码:
g:=StrToInt(Edit3.Text); //maximum iteration count
for x:=0 to Width do
begin
for y:=0 to Height do
begin
zr:=x*(br-ar)/Width+ar;
zi:=y*(bi-ai)/Height+ai;
n:=1;
zr0:=zr;
zi0:=zi;
while (n<g) and (zr*zr+zi*zi<4) do
begin
zrh:=zr;
zr:=zr*zr-zi*zi+zr0;
zi:=zrh*zi+zi*zrh+zi0;
Inc(n) //iterations
end;
n:=Round(n+1-(log2(log2(sqrt(zr*zr+zi*zi))/log2(4)))); //<-- this should smoothen the iterations
Draw_Pixels(n,g,x,y,Image1.Canvas)
end
end;
end;
亨利