// Default Pixel values
this.Pixel.R = 1;
this.Pixel.G = 1;
this.Pixel.B = 1;
this.Pixel.A = 0;
// Calculate the radius of the current Pixel from the center
Radius = sqrt(pow(0.5-X-0.5/BitmapSize,2)+pow(0.5-Y-0.5/BitmapSize,2));
// Function for Pixels that are in the Anti-Aliased outer circle
if(Radius<0.5 && Radius>=0.5-AAWidth/BitmapSize){
this.Pixel.A = (0.5-Radius)*BitmapSize/AAWidth;
}
// Aliased inner circle
if(Radius<0.5-AAWidth/BitmapSize){
this.Pixel.A = 1;
}
That's correct. The BitmapSize constant should be 256 when using a 256x256 Bitmap, and AAWidth represents the width in Pixels of the soft-edge / gradient.