Bitmap/Midpoint circle algorithm: Difference between revisions
Content added Content deleted
(→{{header|REXX}}: removed the need for end-of-earth plot field, simplified the program, added comments and whitespace, changed indentations.) |
(Tweak) |
||
Line 1,563: | Line 1,563: | ||
data.clear(); sz.pump(data,T(Void,rgb.toBigEndian(3))); |
data.clear(); sz.pump(data,T(Void,rgb.toBigEndian(3))); |
||
} |
} |
||
fcn __sGet(x,y){ data.toBigEndian(y*w |
fcn __sGet(x,y) { data.toBigEndian(3*y*w + x,3); } //ppm[x,y] |
||
fcn __sSet(rbg,x,y){ data[y*w |
fcn __sSet(rbg,x,y){ data[3*y*w + x*3,3]=rbg.toBigEndian(3); } //ppm[x,y]=rgb |
||
fcn write(out){ |
fcn write(out){ |
||
out.write("P6\n#rosettacode PPM\n%d %d\n255\n".fmt(w,h)); |
out.write("P6\n#rosettacode PPM\n%d %d\n255\n".fmt(w,h)); |