src/weightedBoxBlurGaussian.js
function gaussianBoxBlur(scl, w, h, r, n, tcl) {
    if (typeof r === 'undefined') r = 1;
    if (typeof n === 'undefined') n = 3;
    if (typeof tcl === 'undefined') tcl = new Float64Array(scl.length);
    var boxes = boxesForGauss(r, n);
    for (var i = 0; i < n; i++) {
        boxBlur(scl, tcl, w, h, (boxes[i]-1)/2);
    }
    return tcl;
}
function gaussianBoxBlur(scl, w, h, r, n, tcl) {
    if (typeof r === 'undefined') r = 1;
    if (typeof n === 'undefined') n = 3;
    if (typeof tcl === 'undefined') tcl = new Float64Array(scl.length);
    var boxes = boxesForGauss(r, n);
    for (var i = 0; i < n; i++) {
        boxBlur(scl, tcl, w, h, (boxes[i]-1)/2);
    }
    return tcl;
}
function gaussianBoxBlur ( scl , w , h , r , n , tcl ) { if ( typeof r === 'undefined' ) r = 1 ; if ( typeof n === 'undefined' ) n = 3 ; if ( typeof tcl === 'undefined' ) tcl = new Float64Array ( scl . length ) ; var boxes = boxesForGauss ( r , n ) ; for ( var i = 0 ; i < n ; i ++ ) { boxBlur ( scl , tcl , w , h , ( boxes [ i ] - 1 ) / 2 ) ; } return tcl ; }
Approximate a Gaussian blur by performing several weighted box blurs.

After this function runs, `tcl` will contain the blurred source channel.
This operation also modifies `scl`.

Lightly modified from http://blog.ivank.net/fastest-gaussian-blur.html
under the MIT license: http://opensource.org/licenses/MIT

Other than style cleanup, the main significant change is that the original
version was used for manipulating RGBA channels in an image, so it assumed
that input and output were integers [0, 255]. This version does not make
such assumptions about the input or output values.

@param Number[] scl
The source channel.
@param Number w
The image width.
@param Number h
The image height.
@param Number [r=1]
The standard deviation (how much to blur).
@param Number [n=3]
The number of box blurs to use in the approximation.
@param Number[] [tcl]
The target channel. Should be different than the source channel. If not
passed, one is created. This is also the return value.

@return Number[]
An array representing the blurred channel.
Approximate a Gaussian blur by performing several weighted box blurs .