// Draws concentric rings running out from
// the center of the image window.
// Based on the bullseye.js script distributed
// with  Kas Thomas' JavaScript Editor plugin at
// http://rsb.info.nih.gov/ij/plugins/javascript.html

  w = 512; h = 512;
  start = getTime();
  xcenter = w/2; ycenter = h/2;
  newImage("Bulls Eye", "RGB", w, h, 1);
  for (y=0; y<h; y++) {
      for (x=0; x<w; x++) {
          dx = x - xcenter; 
          dy = y - ycenter;
          d = sqrt(dx*dx + dy*dy)/10;
          v = (sin(d)+1)*128;
          putPixel(x, y, v<<16);
      }     
      if (y%25==0) updateDisplay();
  }
  showStatus(round((w*h)/((getTime()-start)/1000)) + " pixels/sec");