static public int[] convolve(int[] bufferData ,int h ,int w,float[][] kernel){
		
		int[] tempData = new int[bufferData.length];
		int kh = kernel.length / 2;
		int kw = kernel[0].length / 2;
		
		int i=0,j=0,n=0,m=0;
		
		for (i = 0; i < h; i++) {
            for (j = 0; j < w; j++) {
            	
                int outIndex = (i*w) + (j);
                int r = 0, g = 0, b = 0;
                
                for (n = -kh; n <= kh; n++) {
                    for (m = -kw; m <= kw; m++) {
                        if (i + n >= 0 && i + n < h) {
                            if (j + m >= 0 && j + m < w) {
                            	
                            	float f = kernel[n + kh][m + kw] ;
                                //Can be optimized
                            	//if (f == 0) {continue;}
                                
                                int inIndex = ((i+n)*w) + ((j+m));
                                r += Math.round( Color.red( bufferData[inIndex] ) * f );
                                g += Math.round( Color.green( bufferData[inIndex] ) * f );
                                b += Math.round( Color.blue( bufferData[inIndex]) * f );
                            }
                        }
                    }
                }
                
                tempData[outIndex] = Color.colorToInt(Utils.clamp(r),
						Utils.clamp(g), Utils.clamp(b),255);
            }
		}
		
		return tempData;
	}