/** Sets the current sample to a float value. */ public void setSample(float s) { dst.setSample(s); }
/** Sets the iterator to the leftmost pixel of its bounding rectangle. */ public void startPixels() { src.startPixels(); dst.startPixels(); }
/** * 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); }
iterator.startLines(); if (!iterator.finishedLines()) do { iterator.startPixels(); if (!iterator.finishedPixels()) do { actualValue = iterator.getSampleDouble(); iterator.setSample(newNoData); else if(Math.abs(oldNoData.doubleValue()-actualValue)<=EPS) iterator.setSample(newNoData); else iterator.setSample(actualValue); while (!iterator.nextPixelDone()); while (!iterator.nextLineDone());
public void run() { WritableRectIter writer = RectIterFactory.createWritable(oi, rect); writer.startLines(); int y = rect.y; while (!writer.finishedLines()) { writer.startPixels(); int x = rect.x; while (!writer.finishedPixels()) { final Coordinate realPos = trans.gridToWorldCoordinate(x, y); final double retVal = interpolator.getValue(realPos); writer.setSample(0, retVal); updateStatistics(retVal); writer.nextPixel(); x++; } writer.nextLine(); y++; } } }
iTarget.startBands(); boolean finished = iTarget.finishedBands(); while (!finished) { final double[] row = this.matrix [band]; iTarget.startLines(); finished = iTarget.finishedLines(); for (int i=0; i<iters.length; i++) { iters[i].startLines(); iTarget.startPixels(); finished = iTarget.finishedPixels(); for (int i=0; i<iters.length; i++) { iters[i].startPixels(); value += row[i] * samples[i]; iTarget.setSample(value); finished = iTarget.nextPixelDone(); for (int i=0; i<iters.length; i++) { if (iters[i].nextPixelDone() != finished) { finished = iTarget.nextLineDone(); for (int i=0; i<iters.length; i++) { if (iters[i].nextLineDone() != finished) { finished = iTarget.nextBandDone();
do { do { iter.setSample( keyTable.get(iter.getSample()) ); } while (!iter.nextPixelDone()); iter.startPixels(); } while (!iter.nextLineDone()); iter.startLines(); } while (!iter.nextBandDone());
Arrays.fill(padNaNs, Double.NaN); final WritableRectIter iterator = RectIterFactory.createWritable(tiled, gridBounds); if (!iterator.finishedLines()) try { int y = gridBounds.y; do { iterator.startPixels(); if (!iterator.finishedPixels()) { int x = gridBounds.x; do { coordinate.ordinates[xAxis] = point2D.x; coordinate.ordinates[yAxis] = point2D.y; iterator.setPixel(evaluate(coordinate, samples)); } else { iterator.setPixel(padNaNs); } while (!iterator.nextPixelDone()); assert (x == gridBounds.x + gridBounds.width); y++; } while (!iterator.nextLineDone()); assert (y == gridBounds.y + gridBounds.height); } catch (NoninvertibleTransformException exception) {
public void createRipplesImage(WritableRenderedImage destImg) { // image dimensions final int width = destImg.getWidth(); final int height = destImg.getHeight(); // first pixel coordinates int x = destImg.getMinX(); int y = destImg.getMinY(); // center pixel coordinates final int xc = x + destImg.getWidth() / 2; final int yc = y + destImg.getHeight() / 2; // constant term double C = Math.PI * 8; WritableRectIter iter = RectIterFactory.createWritable(destImg, null); do { double dy = ((double) (y - yc)) / yc; do { double dx = ((double) (x - xc)) / xc; double d = Math.sqrt(dx * dx + dy * dy); iter.setSample(Math.sin(d * C)); x++ ; } while (!iter.nextPixelDone()); x = destImg.getMinX(); y++; iter.startPixels(); } while (!iter.nextLineDone()); } // docs-end-method
/** Sets the iterator to the next pixel in the image (that is, move rightward). */ public boolean nextPixelDone() { boolean check = src.nextPixelDone(); if (check == dst.nextPixelDone()) { return check; } throw new RasterFormatException(ERROR); }
/** Sets the iterator to the first line of its bounding rectangle. */ public void startLines() { src.startLines(); dst.startLines(); }
if (!iterator.finishedBands()) do { categories[band].transform(iterator); band++; while (!iterator.nextBandDone()); assert(band == categories.length) : band;
/** Returns {@code true} if the right edge of the bounding rectangle has been passed. */ public boolean finishedPixels() { boolean check = src.finishedPixels(); if (check == dst.finishedPixels()) { return check; } throw new RasterFormatException(ERROR); }
/** Returns {@code true} if the bottom row of the bounding rectangle has been passed. */ public boolean finishedLines() { boolean check = src.finishedLines(); if (check == dst.finishedLines()) { return check; } throw new RasterFormatException(ERROR); }
/** * Sets the iterator to the next band in the image, and returns {@code true} if the max band has * been exceeded. */ public boolean nextBandDone() { boolean check = src.nextBandDone(); if (check == dst.nextBandDone()) { return check; } throw new RasterFormatException(ERROR); }
/** Returns {@code true} if the max band in the image has been exceeded. */ public boolean finishedBands() { boolean check = src.finishedBands(); if (check == dst.finishedBands()) { return check; } throw new RasterFormatException(ERROR); }
/** Sets the iterator to the next band in the image. */ public void nextBand() { src.nextBand(); dst.nextBand(); }
do { try { iterator.startLines(); if (!iterator.finishedLines()) do { iterator.startPixels(); if (!iterator.finishedPixels()) do { if(isByteData) final int in=iterator.getSample()&0xff; final int out=0xff&lut[bandNumber][in]; iterator.setSample(out); } while (!iterator.nextPixelDone()); } while (!iterator.nextLineDone()); } catch (final Exception cause) { final RasterFormatException exception = new RasterFormatException( } while (iterator.finishedBands());
public void run() { WritableRectIter writer = RectIterFactory.createWritable(oi, rect); writer.startLines(); int y = rect.y; while (!writer.finishedLines()) { writer.startPixels(); int x = rect.x; while (!writer.finishedPixels()) { final Coordinate realPos = trans.gridToWorldCoordinate(x, y); final double retVal = interpolator.getValue(realPos); writer.setSample(0, retVal); updateStatistics(retVal); writer.nextPixel(); x++; } writer.nextLine(); y++; } } }
iTarget.startBands(); boolean finished = iTarget.finishedBands(); while (!finished) { final double[] row = this.matrix [band]; iTarget.startLines(); finished = iTarget.finishedLines(); for (int i=0; i<iters.length; i++) { iters[i].startLines(); iTarget.startPixels(); finished = iTarget.finishedPixels(); for (int i=0; i<iters.length; i++) { iters[i].startPixels(); value += row[i] * samples[i]; iTarget.setSample(value); finished = iTarget.nextPixelDone(); for (int i=0; i<iters.length; i++) { if (iters[i].nextPixelDone() != finished) { finished = iTarget.nextLineDone(); for (int i=0; i<iters.length; i++) { if (iters[i].nextLineDone() != finished) { finished = iTarget.nextBandDone();