index.js
function(x, y) {
        //avoid negatives
        if (this.seamless) {
            x = (x%this.size + this.size)%this.size
            y = (y%this.size + this.size)%this.size
        } else {
            x = clamp(x, 0, this.size)
            y = clamp(y, 0, this.size)
        }

        if (this.smooth)
            return sampling.bilinear(this.data, this.size, this.size, x, y);
        else
            return sampling.nearest(this.data, this.size, this.size, x, y);
    }
function(x, y) {
        //avoid negatives
        if (this.seamless) {
            x = (x%this.size + this.size)%this.size
            y = (y%this.size + this.size)%this.size
        } else {
            x = clamp(x, 0, this.size)
            y = clamp(y, 0, this.size)
        }

        if (this.smooth)
            return sampling.bilinear(this.data, this.size, this.size, x, y);
        else
            return sampling.nearest(this.data, this.size, this.size, x, y);
    }
function ( x , y ) { //avoid negatives if ( this . seamless ) { x = ( x % this . size + this . size ) % this . size y = ( y % this . size + this . size ) % this . size } else { x = clamp ( x , 0 , this . size ) y = clamp ( y , 0 , this . size ) } if ( this . smooth ) return sampling . bilinear ( this . data , this . size , this . size , x , y ) ; else return sampling . nearest ( this . data , this . size , this . size , x , y ) ; }
returns a float, -1 to 1
returns a float - 1 to 1