Bitmap/Midpoint circle algorithm: Difference between revisions
Content added Content deleted
(→{{header|zkl}}: update) |
(Updated D entry) |
||
Line 367: | Line 367: | ||
void circle(Color)(Image!Color img, in int x0, in int y0, |
void circle(Color)(Image!Color img, in int x0, in int y0, |
||
in int radius, in Color color) |
in int radius, in Color color) |
||
pure nothrow @nogc @safe { |
|||
int f = 1 - radius; |
int f = 1 - radius; |
||
int ddfX = 1; |
int ddfX = 1; |
||
Line 398: | Line 399: | ||
} |
} |
||
void main() { |
void main() @safe { |
||
auto img = new Image!RGB(25, 25); |
auto img = new Image!RGB(25, 25); |
||
img.clear(RGB.white); |
img.clear(RGB.white); |