src/canvas/ImageGridIndex.js
function(image, x, y, options) {
        var result = false;
        var data = options.data;
        if (!data)
            return result;
        var mask = this._getImageMask(image, options);
        var imageMaskWidth = this._getMaskX(image.width);
        var maskShiftX = this._getMaskX(x);
        var maskShiftY = this._getMaskY(y);
        for (var i = 0; i < mask.length; i++) {
            if (!mask[i])
                continue;
            var maskX = maskShiftX + (i % imageMaskWidth);
            var maskY = maskShiftY + Math.floor(i / imageMaskWidth);
            var key = this._getIndexKey(maskX, maskY);
            this._addDataToIndex(key, options);
            result = true;
        }
        return result;
    }
function(image, x, y, options) {
        var result = false;
        var data = options.data;
        if (!data)
            return result;
        var mask = this._getImageMask(image, options);
        var imageMaskWidth = this._getMaskX(image.width);
        var maskShiftX = this._getMaskX(x);
        var maskShiftY = this._getMaskY(y);
        for (var i = 0; i < mask.length; i++) {
            if (!mask[i])
                continue;
            var maskX = maskShiftX + (i % imageMaskWidth);
            var maskY = maskShiftY + Math.floor(i / imageMaskWidth);
            var key = this._getIndexKey(maskX, maskY);
            this._addDataToIndex(key, options);
            result = true;
        }
        return result;
    }
function ( image , x , y , options ) { var result = false ; var data = options . data ; if ( ! data ) return result ; var mask = this . _getImageMask ( image , options ) ; var imageMaskWidth = this . _getMaskX ( image . width ) ; var maskShiftX = this . _getMaskX ( x ) ; var maskShiftY = this . _getMaskY ( y ) ; for ( var i = 0 ; i < mask . length ; i ++ ) { if ( ! mask [ i ] ) continue ; var maskX = maskShiftX + ( i % imageMaskWidth ) ; var maskY = maskShiftY + Math . floor ( i / imageMaskWidth ) ; var key = this . _getIndexKey ( maskX , maskY ) ; this . _addDataToIndex ( key , options ) ; result = true ; } return result ; }
Adds all pixels occupied by the specified image to a data mask associated
with canvas.
Adds all pixels occupied by the specified image to a data mask associated with canvas .