src/canvas/ImageGridIndex.js
function(image) {
        var maskWidth = this._getMaskX(image.width);
        var maskHeight = this._getMaskY(image.height);
        var buf = this._getResizedImageBuffer(image, maskWidth, maskHeight);
        var mask = new Array(maskWidth * maskHeight);
        for (var y = 0; y < maskHeight; y++) {
            for (var x = 0; x < maskWidth; x++) {
                var idx = (y * maskWidth + x);
                var filled = this._checkFilledPixel(buf, idx);
                mask[idx] = filled ? 1 : 0;
            }
        }
        return mask;
    }
function(image) {
        var maskWidth = this._getMaskX(image.width);
        var maskHeight = this._getMaskY(image.height);
        var buf = this._getResizedImageBuffer(image, maskWidth, maskHeight);
        var mask = new Array(maskWidth * maskHeight);
        for (var y = 0; y < maskHeight; y++) {
            for (var x = 0; x < maskWidth; x++) {
                var idx = (y * maskWidth + x);
                var filled = this._checkFilledPixel(buf, idx);
                mask[idx] = filled ? 1 : 0;
            }
        }
        return mask;
    }
function ( image ) { var maskWidth = this . _getMaskX ( image . width ) ; var maskHeight = this . _getMaskY ( image . height ) ; var buf = this . _getResizedImageBuffer ( image , maskWidth , maskHeight ) ; var mask = new Array ( maskWidth * maskHeight ) ; for ( var y = 0 ; y < maskHeight ; y ++ ) { for ( var x = 0 ; x < maskWidth ; x ++ ) { var idx = ( y * maskWidth + x ) ; var filled = this . _checkFilledPixel ( buf , idx ) ; mask [ idx ] = filled ? 1 : 0 ; } } return mask ; }
Creates and returns an image mask.
Creates and returns an image mask .