      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; elevationData[offset];
            pixel[1] &#x3D; elevationData[offset + 1];
            pixel[2] &