Revision 10996 trunk/libraries/libRaster/src/org/gvsig/raster/util/Histogram.java

View differences:

Histogram.java
126 126
	 * Devuelve el histograma acumulado
127 127
	 * @return
128 128
	 */
129

  
129 130
	public long[][] getAccumulatedHistogram() {
130
		if(histogram != null){
131
		if (histogram != null){
131 132
			long[][] hist = new long[histogram.length][histogram[0].length];
132 133
			for (int iBand = 0; iBand < hist.length; iBand++) {
133
				for (int j = 0; j < hist[iBand].length; j++) {
134
					if(j == 0)
135
						hist[iBand][j] = histogram[iBand][j];
136
					else
137
						hist[iBand][j] += histogram[iBand][j - 1]; 	
134
				hist[iBand][0] = histogram[iBand][0];
135
				for (int j = 1; j < hist[iBand].length; j++) {
136
					hist[iBand][j] = hist[iBand][j - 1] + histogram[iBand][j];
138 137
				}
139 138
			}
139
			return hist;
140 140
		}
141 141
		return null;
142 142
	}

Also available in: Unified diff