/** * Sets the iterator to the next line in the image, and returns {@code true} if the bottom row * of the bounding rectangle has been passed. */ public boolean nextLineDone() { boolean check = src.nextLineDone(); if (check == dst.nextLineDone()) { return check; } throw new RasterFormatException(ERROR); }
@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()); } }
if (!iterator.nextLineDone()) iterator.startPixels();
} while (!iter.nextPixelDone()); assert i == row.length; } while (!iter.nextLineDone()); assert j == samples.length;
} while (!iter.nextPixelDone()); assert i == row.length; } while (!iter.nextLineDone()); assert j == samples.length;
} while (!iter.nextPixelDone()); assert i == row.length; } while (!iter.nextLineDone()); assert j == samples.length;
/** * Sets the iterator to the next line in the image. */ public boolean nextLineDone() { if (iterator.nextLineDone()) { return true; } iterator.jumpLines(dy); return false; }
/** * Sets the iterator to the next line in the image, * and returns {@code true} if the bottom row of the bounding rectangle has been passed. */ public boolean nextLineDone() { boolean check = src.nextLineDone(); if (check == dst.nextLineDone()) { return check; } throw new RasterFormatException(ERROR); }
/** * Sets the iterator to the next line in the image, * and returns {@code true} if the bottom row of the bounding rectangle has been passed. */ public boolean nextLineDone() { boolean check = src.nextLineDone(); if (check == dst.nextLineDone()) { return check; } throw new RasterFormatException(ERROR); }
/** * Sets the iterator to the next line in the image, * and returns {@code true} if the bottom row of the bounding rectangle has been passed. * * @return {@code true} if the iteration over lines is finished. */ @Override public boolean nextLineDone() { boolean check = src.nextLineDone(); if (check == dst.nextLineDone()) { return check; } throw new RasterFormatException(ERROR); }
/** * Sets the delegate iterator position. If {@code newPos} is outside * the target image bounds, the delegate iterator does not move. */ protected void setDelegatePosition() { if (isInsideDelegateBounds()) { int dy = mainPos.y - delegatePos.y; if (dy < 0) { delegateIter.startLines(); delegatePos.y = delegateBounds.y; dy = mainPos.y - delegateBounds.y; } while (dy > 0) { delegateIter.nextLineDone(); delegatePos.y++ ; dy--; } int dx = mainPos.x - delegatePos.x; if (dx < 0) { delegateIter.startPixels(); delegatePos.x = delegateBounds.x; dx = mainPos.x - delegateBounds.x; } while (dx > 0) { delegateIter.nextPixelDone(); delegatePos.x++ ; dx--; } } }
if(!iterator.nextLineDone()) iterator.startPixels();
numSampleValues += size.width; iterator.startPixels(); } while (!iterator.nextLineDone());
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()); } }
destIter.nextPixelDone(); srcIter.nextLineDone(); srcIter.startPixels(); destIter.nextLineDone(); destIter.startPixels();
private void assertResult(RenderedImage resultImage, String script) throws Exception { JiffleBuilder builder = new JiffleBuilder(); builder.script(script).dest("dest", WIDTH, WIDTH).run(); RenderedImage referenceImage = builder.getImage("dest"); RectIter resultIter = RectIterFactory.create(resultImage, null); RectIter referenceIter = RectIterFactory.create(referenceImage, null); do { do { assertEquals(resultIter.getSample(), referenceIter.getSample()); resultIter.nextPixelDone(); } while (!referenceIter.nextPixelDone()); resultIter.startPixels(); resultIter.nextLineDone(); referenceIter.startPixels(); } while (!referenceIter.nextLineDone()); } }
destIter.nextPixelDone(); srcIter.nextLineDone(); srcIter.startPixels(); destIter.nextLineDone(); destIter.startPixels();
/** * 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()); }
} while (!srcIter.nextLineDone()); } else { final int minX = srcImg.getMinX();
a.startPixels(); e.startPixels(); } while (!e.nextLineDone()); assertTrue(a.finishedLines());