dist/axis3d.js
/**
 * Scales an image at a given scale and near power of two scale into a returned
 * canvas DOM element.
 * scaleImageIntoCanvas(image: HTMLImageElement,
 *                      scale: HTMLCanvasElement,
 *                      scaleNearestPowerOfTwo: Number) -> HTMLCanvasElement
 */
Scales an image at a given scale and near power of two scale into a returned
canvas DOM element.
Scales an image at a given scale and near power of two scale into a returned canvas DOM element .
function scaleImageIntoCanvas(image, scale, scaleNearestPowerOfTwo) {
  var canvas = createCanvas();
  var context = canvas.getContext('2d');
  var width = image.width,
      height = image.height;
  if (scaleNearestPowerOfTwo) {
    width = nearestPowerOfTwo(width);
    height = nearestPowerOfTwo(height);
  }
  canvas.width = Math.floor(image.width * scale);
  canvas.height = Math.floor(image.height * scale);
  context.drawImage(image, 0, 0, width, height, 0, 0, canvas.width, canvas.height);
  return canvas;
}
function scaleImageIntoCanvas ( image , scale , scaleNearestPowerOfTwo ) { var canvas = createCanvas ( ) ; var context = canvas . getContext ( '2d' ) ; var width = image . width , height = image . height ; if ( scaleNearestPowerOfTwo ) { width = nearestPowerOfTwo ( width ) ; height = nearestPowerOfTwo ( height ) ; } canvas . width = Math . floor ( image . width * scale ) ; canvas . height = Math . floor ( image . height * scale ) ; context . drawImage ( image , 0 , 0 , width , height , 0 , 0 , canvas . width , canvas . height ) ; return canvas ; }
Scales an image at a given scale and near power of two scale into a returned
 canvas DOM element.
Scales an image at a given scale and near power of two scale into a returned canvas DOM element .