lib/lpyramid.js
function (a, b) {
		var Kernel = [0.05, 0.25, 0.4, 0.25, 0.05];

		var width = this.getWidth();
		var weight = this.getWeight();

		//#pragma omp parallel for
		for (var y = 0; y < weight; y++) {
			for (var x = 0; x < width; x++) {

				var index = y * width + x;
				a[index] = 0;

				for (var i = -2; i <= 2; i++) {
					for (var j = -2; j <= 2; j++) {

						var nx = x + i;
						var ny = y + j;

						if (nx < 0) nx = -nx;
						if (ny < 0) ny = -ny;
						if (nx >= width) nx = (width << 1) - nx - 1;
						if (ny >= weight) ny = (weight << 1) - ny - 1;

						a[index] += Kernel[i + 2] * Kernel[j + 2] * b[ny * width + nx];
					}
				}
			}
		}
	}
function (a, b) {
		var Kernel = [0.05, 0.25, 0.4, 0.25, 0.05];

		var width = this.getWidth();
		var weight = this.getWeight();

		//#pragma omp parallel for
		for (var y = 0; y < weight; y++) {
			for (var x = 0; x < width; x++) {

				var index = y * width + x;
				a[index] = 0;

				for (var i = -2; i <= 2; i++) {
					for (var j = -2; j <= 2; j++) {

						var nx = x + i;
						var ny = y + j;

						if (nx < 0) nx = -nx;
						if (ny < 0) ny = -ny;
						if (nx >= width) nx = (width << 1) - nx - 1;
						if (ny >= weight) ny = (weight << 1) - ny - 1;

						a[index] += Kernel[i + 2] * Kernel[j + 2] * b[ny * width + nx];
					}
				}
			}
		}
	}
function ( a , b ) { var Kernel = [ 0.05 , 0.25 , 0.4 , 0.25 , 0.05 ] ; var width = this . getWidth ( ) ; var weight = this . getWeight ( ) ; //#pragma omp parallel for for ( var y = 0 ; y < weight ; y ++ ) { for ( var x = 0 ; x < width ; x ++ ) { var index = y * width + x ; a [ index ] = 0 ; for ( var i = - 2 ; i <= 2 ; i ++ ) { for ( var j = - 2 ; j <= 2 ; j ++ ) { var nx = x + i ; var ny = y + j ; if ( nx < 0 ) nx = - nx ; if ( ny < 0 ) ny = - ny ; if ( nx >= width ) nx = ( width << 1 ) - nx - 1 ; if ( ny >= weight ) ny = ( weight << 1 ) - ny - 1 ; a [ index ] += Kernel [ i + 2 ] * Kernel [ j + 2 ] * b [ ny * width + nx ] ; } } } } }
Convolves image b with the filter kernel and stores it in a.
Convolves image b with the filter kernel and stores it in a .