private static void pBlur(int[][] samples, int[][][] src, int[][] dm, int[][][] dest, int x, int y, float maxDist){
        int width = src[0].length;
        int height = src[0][0].length;
        
        for(int c = 0; c < src.length; c++){
            int count = 0;
            int sum = 0;
            for(int i = 0; i < samples.length; i++){
                int sx = x + samples[i][0];
                int sy = y + samples[i][1];
            	float dist = (float)Math.sqrt(Math.abs(samples[i][0]) + Math.abs(samples[i][1]));
                if(sx >= 0 && sx < width){
                    if(sy >= 0 && sy < height){
                    	if(dist <= (maxDist * (float)dm[sx][sy] / 256.0)){
                    		count++;
                    		sum += src[c][sx][sy];
                    	} else {
                    		count++;
                    		sum += src[c][x][y];
                    	}
                    }
                }
            }
            int avg = src[c][x][y];
            if(count > 0)
            	avg = sum / count;
            dest[c][x][y] = avg;
        }
    }