#include /* D(R,y) = |P2-P| = ceil(sqrt(R2-y2)) - sqrt(R2-y2) */ static double D(int r, int y) { return ceil(sqrt(r*r - y*y)) - sqrt(r*r - y*y); } static gdImagePtr HmmPtr; static void hmm(int x,int y,double I, int k) { int r = (k >> 16) & 255, g = (k >> 8) & 255, b = (k) & 255; int c = gdImageGetPixel(HmmPtr, x,y); //c=0; r = ((c >> 16) & 255) * (1-I) + r * I; g = ((c >> 8) & 255) * (1-I) + g * I; b = (c & 255) * (1-I) + b * I; //printf("%X: %d %d %d\n", k, r,g,b); c = b + g*256 + r*256*256; //c = gdImageColorAllocate(HmmPtr, r,g,b); gdImageSetPixel(HmmPtr, x,y, c); } static void putpixel(int cx,int cy, int x,int y,double I, int c) { hmm(cx + y, cy + x, I, c); hmm(cx - y, cy + x, I, c); hmm(cx + y, cy - x, I, c); hmm(cx - y, cy - x, I, c); hmm(cx + x, cy + y, I, c); hmm(cx - x, cy + y, I, c); hmm(cx + x, cy - y, I, c); hmm(cx - x, cy - y, I, c); } static void WUCircle(int cx,int cy, int R, int filled, int c) { int x = R; int y = 0; int ax; double T = 0; double I = 0.93; if(filled)for(ax=0; axy) { ++y; if (D(R,y) < T) --x; putpixel(cx,cy, x,y,I*(1-D(R,y)), c); if(!filled)putpixel(cx,cy, x-1,y,I*D(R,y), c); if(filled)for(ax=0; ax