|
|
@ -118,35 +118,29 @@ Canvas.prototype.createSyncPNGStream = function(){ |
|
|
|
/** |
|
|
|
* Create a `JPEGStream` for `this` canvas. |
|
|
|
* |
|
|
|
* @param {Object} [opts] Can optionally contain bufsize or quality settings |
|
|
|
* @param {Object} options |
|
|
|
* @return {JPEGStream} |
|
|
|
* @api public |
|
|
|
*/ |
|
|
|
|
|
|
|
Canvas.prototype.createJPEGStream = function(opts){ |
|
|
|
opts = opts || {}; |
|
|
|
options = { |
|
|
|
bufsize : opts.bufsize || 4096, |
|
|
|
quality : opts.quality || 60, |
|
|
|
}; |
|
|
|
return new JPEGStream(this, options); |
|
|
|
Canvas.prototype.createJPEGStream = function(options){ |
|
|
|
return this.createSyncJPEGStream(options); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
* Create a synchronous `JPEGStream` for `this` canvas. |
|
|
|
* |
|
|
|
* @param {Object} [opts] Can optionally contain bufsize or quality settings |
|
|
|
* @param {Object} options |
|
|
|
* @return {JPEGStream} |
|
|
|
* @api public |
|
|
|
*/ |
|
|
|
|
|
|
|
Canvas.prototype.createSyncJPEGStream = function(opts){ |
|
|
|
opts = opts || {}; |
|
|
|
options = { |
|
|
|
bufsize : opts.bufsize || 4096, |
|
|
|
quality : opts.quality || 60, |
|
|
|
}; |
|
|
|
return new JPEGStream(this, options, true); |
|
|
|
Canvas.prototype.createSyncJPEGStream = function(options){ |
|
|
|
options = options || {}; |
|
|
|
return new JPEGStream(this, { |
|
|
|
bufsize: options.bufsize || 4096 |
|
|
|
, quality: options.quality || 75 |
|
|
|
}, true); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|