public int getSample(int x, int y, int b) { return delegate.getSample(x, y, b); }
double value = iter.getSampleDouble(x, y, 0); if (!Double.isNaN(value)) { int value = iter.getSample(x, y, 0);
public void done() { delegate.done(); op.dispose(); } }
case SHORT: case INT: sample = data.getSample(x, y, 0); validSample = !Double.isNaN(noDataValue) && !isNaN(sample, noDataValue); if (unitConverter != null && validSample) { break; case FLOAT: float sampleFloat = data.getSampleFloat(x, y, 0); validSample = !Double.isNaN(noDataValue) && !isNaN(sampleFloat, noDataValue); if (unitConverter != null && validSample) { double sampleDouble = data.getSampleDouble(x, y, 0); validSample = !Double.isNaN(noDataValue) && !isNaN(sampleDouble, noDataValue); if (unitConverter != null && !Double.isNaN(noDataValue) && !isNaN(sampleDouble, noDataValue)) {
public double getSampleDouble(int x, int y, int b) { return delegate.getSampleDouble(x, y, b); }
for (int j = 0; j < kheight; j++) { for (int i = 0; i < kwidth; i++) { samples[j][i] = iter.getSampleDouble(xint + i, yint + j, b); iter.done();
data[b][pixelOffset + bandOffsets[b]] = iter.getSampleFloat(sx, sy, b); if (!(roiBounds.contains(sx, sy) && roiIter.getSample(sx, sy, 0) > 0)) { data[b][pixelOffset + bandOffsets[b]] = iter.getSampleFloat(sx, sy, b); inputValue = iter.getSampleFloat(sx, sy, b); if (noDataRange.contains(inputValue)) { data[b][pixelOffset + bandOffsets[b]] = (float)backgroundValues[b]; if (!(roiBounds.contains(sx, sy) && roiIter.getSample(sx, sy, 0) > 0)) { inputValue = iter.getSampleFloat(sx, sy, b); if (noDataRange.contains(inputValue)) { data[b][pixelOffset + bandOffsets[b]] = (float)backgroundValues[b]; iter.done();
data[b][pixelOffset + bandOffsets[b]] = iter.getSampleDouble(sx, sy, b); if (!(roiBounds.contains(sx, sy) && roiIter.getSample(sx, sy, 0) > 0)) { data[b][pixelOffset + bandOffsets[b]] = iter.getSampleDouble(sx, sy, b); inputValue = iter.getSampleDouble(sx, sy, b); if (noDataRange.contains(inputValue)) { data[b][pixelOffset + bandOffsets[b]] = backgroundValues[b]; if (!(roiBounds.contains(sx, sy) && roiIter.getSample(sx, sy, 0) > 0)) { inputValue = iter.getSampleDouble(sx, sy, b); if (noDataRange.contains(inputValue)) { data[b][pixelOffset + bandOffsets[b]] = backgroundValues[b]; iter.done();
/** Method for testing the selected input RandomIter on an Integral image */ public void testRandomIterInt(RenderedImage img, int[] valueArray, boolean cachedTiles, boolean arrayCalculation) { RandomIter iter = RandomIterFactory.create(img, null, cachedTiles, arrayCalculation); int[] array = new int[3]; // Store of the image data calculated for (int i = 0; i < indexArray.length; i++) { int x = indexArray[i][0]; int y = indexArray[i][1]; int valueExpected = iter.getSample(x, y, 0); assertEquals(valueExpected, valueArray[i]); int valueExpectedArray = iter.getPixel(x, y, array)[0]; assertEquals(valueExpectedArray, valueArray[i]); } }
public double[] getPixel(int x, int y, double[] dArray) { return delegate.getPixel(x, y, dArray); }
/** Method for testing the selected input RandomIter on a Double image */ public void testRandomIterDouble(RenderedImage img, double[] valueArray, boolean cachedTiles, boolean arrayCalculation) { RandomIter iter = RandomIterFactory.create(img, null, cachedTiles, arrayCalculation); double[] array = new double[3]; // Store of the image data calculated for (int i = 0; i < indexArray.length; i++) { int x = indexArray[i][0]; int y = indexArray[i][1]; double valueExpected = iter.getSampleDouble(x, y, 0); assertEquals(valueExpected, valueArray[i], DELTA); double valueExpectedArray = iter.getPixel(x, y, array)[0]; assertEquals(valueExpectedArray, valueArray[i], DELTA); } }
public float getSampleFloat(int x, int y, int b) { return delegate.getSampleFloat(x, y, b); }
for (int j = 0; j < kheight; j++) { for (int i = 0; i < kwidth; i++) { samples[j][i] = iter.getSampleFloat(xint + i, yint + j, b); iter.done();
/** Method for testing the selected input RandomIter on a Float image */ public void testRandomIterFloat(RenderedImage img, float[] valueArray, boolean cachedTiles, boolean arrayCalculation) { RandomIter iter = RandomIterFactory.create(img, null, cachedTiles, arrayCalculation); float[] array = new float[3]; // Store of the image data calculated for (int i = 0; i < indexArray.length; i++) { int x = indexArray[i][0]; int y = indexArray[i][1]; float valueExpected = iter.getSampleFloat(x, y, 0); assertEquals(valueExpected, valueArray[i], DELTA); float valueExpectedArray = iter.getPixel(x, y, array)[0]; assertEquals(valueExpectedArray, valueArray[i], DELTA); } }
int y = indexArray[i][1]; valueArrayByte[i] = iterByte.getSample(x, y, 0); valueArrayShort[i] = iterShort.getSample(x, y, 0); valueArrayInt[i] = iterInt.getSample(x, y, 0); valueArrayByteIMGFloat[i] = iterByteIMGFloat.getSampleFloat(x, y, 0); valueArrayShortIMGFloat[i] = iterShortIMGFloat.getSampleFloat(x, y, 0); valueArrayIntIMGFloat[i] = iterIntIMGFloat.getSampleFloat(x, y, 0); valueArrayByteIMGDouble[i] = iterByteIMGDouble.getSampleDouble(x, y, 0); valueArrayShortIMGDouble[i] = iterShortIMGDouble.getSampleDouble(x, y, 0); valueArrayIntIMGDouble[i] = iterIntIMGDouble.getSampleDouble(x, y, 0);
for (int i = 0; i < dataWindowRows; i++) { for (int j = 0; j < dataWindowCols; j++) { double value = iterator.getSampleDouble(j, i, 0);
assert minScanI>=0 && minScanI<=distances.length : minScanI; for (int x=minX; x<maxX; x++) { final double current = iter.getSampleDouble(x, y, band); if (!Double.isNaN(current)) { for (int sy=minScanY; sy<maxScanY; sy++) { for (int sx=minScanX; sx<maxScanX; sx++) { final double scan = iter.getSampleDouble(sx, sy, band); if (!Double.isNaN(scan)) { final double d = distances[index]; iter.done();