/** Returns the specified sample of the current pixel as a double. */ public double getSampleDouble(int b) { return src.getSampleDouble(b); }
/** Returns the current sample as a double. */ public double getSampleDouble() { return src.getSampleDouble(); }
@SuppressWarnings("PMD.SystemPrintln") public static void printImage(RenderedImage renderedImage) { RectIter rectIter = RectIterFactory.create(renderedImage, null); do { do { double value = rectIter.getSampleDouble(); System.out.print(value + " "); } while (!rectIter.nextPixelDone()); rectIter.startPixels(); } while (!rectIter.nextLineDone()); } }
int i = 0; do { double sampleDouble = iter.getSampleDouble(band);
/** * Returns the current sample as a double. */ public double getSampleDouble() { return src.getSampleDouble(); }
/** * Returns the current sample as a double. */ public double getSampleDouble() { return src.getSampleDouble(); }
/** * Returns the specified sample of the current pixel as a double. */ public double getSampleDouble(int b) { return src.getSampleDouble(b); }
/** * Returns the specified sample of the current pixel as a double. */ public double getSampleDouble(int b) { return src.getSampleDouble(b); }
/** * Returns the current sample as a double. * * @return The current sample value. */ @Override public double getSampleDouble() { return src.getSampleDouble(); }
/** * Returns the specified sample of the current pixel as a double. * * @param b The band for which to get the sample value. * @return The sample value at the given band. */ @Override public double getSampleDouble(int b) { return src.getSampleDouble(b); }
public double getSampleDouble() {return iterator.getSampleDouble();} public double getSampleDouble(int b) {return iterator.getSampleDouble(sourceBands[b]);}
public double getSampleDouble(int b) {return iterator.getSampleDouble(sourceBands[b]);}
private void extractValues() { coordinates.clear(); int column = bounds.x; int row = bounds.y + currentRow; readIter.startPixels(); while (!readIter.finishedPixels()) { double sampleValue = readIter.getSampleDouble(bandIndex); if (retainNoData) { Coordinate coord = trans.gridToWorldCoordinate(column, row); coord.z = sampleValue; coordinates.add(coord); } else { if (!SSUtils.compareDouble(noData, sampleValue)) { Coordinate coord = trans.gridToWorldCoordinate(column, row); coord.z = sampleValue; coordinates.add(coord); } } column++; readIter.nextPixel(); } currentRow++; readIter.nextLine(); }
private void extractValues() { coordinates.clear(); int column = bounds.x; int row = bounds.y + currentRow; readIter.startPixels(); while (!readIter.finishedPixels()) { double sampleValue = readIter.getSampleDouble(bandIndex); if (retainNoData) { Coordinate coord = trans.gridToWorldCoordinate(column, row); coord.z = sampleValue; coordinates.add(coord); } else { if (!SSUtils.compareDouble(noData, sampleValue)) { Coordinate coord = trans.gridToWorldCoordinate(column, row); coord.z = sampleValue; coordinates.add(coord); } } column++; readIter.nextPixel(); } currentRow++; readIter.nextLine(); }
public void visit(GridCoverage2D inputCoverage, Integer bandIndex) { reset(); PlanarImage inputImage = (PlanarImage) inputCoverage.getRenderedImage(); RectIter readIter = RectIterFactory.create(inputImage, inputImage.getBounds()); readIter.startLines(); while (!readIter.finishedLines()) { readIter.startPixels(); while (!readIter.finishedPixels()) { double sampleValue = readIter.getSampleDouble(bandIndex); visit(Double.valueOf(sampleValue)); readIter.nextPixel(); } readIter.nextLine(); } }
val = (short) srcIter.getSampleDouble(); break;
protected void assertImage(RenderedImage srcImg, RenderedImage destImg, Evaluator evaluator) { RectIter destIter = RectIterFactory.create(destImg, null); if (srcImg != null) { RectIter srcIter = RectIterFactory.create(srcImg, null); do { do { assertEquals(evaluator.eval(srcIter.getSampleDouble()), destIter.getSampleDouble(), TOL); destIter.nextPixelDone(); } while (!srcIter.nextPixelDone()); srcIter.startPixels(); destIter.startPixels(); destIter.nextLineDone(); } while (!srcIter.nextLineDone()); } else { do { do { assertEquals(evaluator.eval(0), destIter.getSampleDouble(), TOL); } while (!destIter.nextPixelDone()); destIter.startPixels(); } while (!destIter.nextLineDone()); } }
double val = srcIter.getSampleDouble(); double z = destIter.getSampleDouble(); assertTrue(CompareOp.acompare(z, val) >= 0); assertTrue(CompareOp.acompare(z, 2*val) <= 0);
for (int y = 0; y < WIDTH; y++) { for (int x = 0; x < WIDTH; x++) { assertEquals((double)x + y, iter.getSampleDouble(), TOL); iter.nextPixel();
/** * Ensures that all sample values in every bands are either inside the given range, * or {@link Double#NaN}. * * @param minimum The lower bound of the range, inclusive. * @param maximum The upper bound of the range, inclusive. * @param image The image to test. * * @since 3.19 */ public static void assertSampleValuesInRange(final double minimum, final double maximum, final RenderedImage image) { final RectIter it = RectIterFactory.create(image, null); if (!it.finishedLines()) do { if (!it.finishedPixels()) do { if (!it.finishedBands()) do { final double value = it.getSampleDouble(); assertBetween("Sample value", minimum, maximum, value); } while (!it.nextBandDone()); it.startBands(); } while (!it.nextPixelDone()); it.startPixels(); } while (!it.nextLineDone()); }