sIncidence, scaled;
  for (pixelY &#x3D; 0; pixelY &lt;&#x3D; maxY; ++pixelY) {
    y0 &#x3D; pixelY &#x3D;&#x3D;&#x3D; 0 ? 0 : pixelY - 1;
    y1 &#x3D; pixelY &#x3D;&#x3D;&#x3D; maxY ? maxY : pixelY + 1;
    for (pixelX &#x3D; 0; pixelX &lt;&#x3D; maxX; ++pixelX) {
      x0 &#x3D; pixelX &#x3D;&#x3D;&#x3D; 0 ? 0 : pixelX - 1;
      x1 &#x3D; pixelX &#x3D;&#x3D;&#x3D; maxX ? maxX : pixelX + 1;

      // determine elevation for (x0, pixelY)
      offset &#x3D; (pixelY * width + x0) * 4;
      pixel[0] &#x3D