code: function Canvas(width, height, buffer) {
      width  = _.defaults(width , 640)|0;
      height = _.defaults(height, 400)|0;
  
      if (Canvas.isCanvasRGB(width, height, buffer)) {
        return new CanvasRGB(width, height, buffer);
      }
      if (Canvas.isCanvasRGBA(width, height, buffer)) {
        return new CanvasRGBA(width, height, buffer);
      }
  
      var $ = dollar(width, height, 1, buffer);
  
      $.putPixel = function(x, y, color) {
        var index = y * width + x;
  
        if ($.mask && $.mask[index] === 0) {
          return;
        }
  
        var colorIndex = color.valueOf(x, y);
  
        if (colorIndex !== -1) {
          $.data[index] = colorIndex & 15;
        }
      };
  
      this.$ = $;
    }
docs: Canvas
  
  @param  {int} [width=640]
  @param  {int} [height=400]
  @param  {Uint8Array} [buffer]
  @return {Canvas}