javax.media.jai.iterator.RectIter.finishedPixels()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中javax.media.jai.iterator.RectIter.finishedPixels方法的一些代码示例,展示了RectIter.finishedPixels的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RectIter.finishedPixels方法的具体详情如下:
包路径:javax.media.jai.iterator.RectIter
类名称:RectIter
方法名:finishedPixels

RectIter.finishedPixels介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

/** 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);
}

代码示例来源:origin: geotools/geotools

public RasterAsPointFeatureIterator(final RasterAsPointFeatureCollection fc) {
  // checks
  Utilities.ensureNonNull("fc", fc);
  // get elements
  this.fc = fc;
  this.fb = new SimpleFeatureBuilder(fc.getSchema());
  this.size = fc.size;
  // create an iterator that only goes forward, it is the fastest one
  iterator = RectIterFactory.create(fc.gc2d.getRenderedImage(), null);
  //
  // start the iterator
  //
  iterator.startLines();
  if (iterator.finishedLines()) {
    throw new NoSuchElementException("Index beyond size:" + index + ">" + size);
  }
  iterator.startPixels();
  if (iterator.finishedPixels()) {
    throw new NoSuchElementException("Index beyond size:" + index + ">" + size);
  }
  // appo
  temp = new double[fc.numBands];
  // grid convergence angle manager
  if (fc.gridConvergenceAngleCorrectionNeeded) {
    sourceCRSPosition = new DirectPosition2D();
    targetCRSPosition = new DirectPosition2D(fc.targetCRS);
  }
}

代码示例来源:origin: geotools/geotools

if (iterator.finishedPixels()) {
  throw new NoSuchElementException("Index beyond size:" + index + ">" + size);

代码示例来源:origin: org.geotools/gt2-coverageio

/**
 * Returns true if the right edge of the bounding rectangle has been passed.
 */
public boolean finishedPixels() {
  return iterator.finishedPixels();
}

代码示例来源:origin: org.geotools/gt-coverage

/**
 * 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);
}

代码示例来源:origin: org.geotools/gt2-coverage

/**
 * 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);
}

代码示例来源:origin: Geomatys/geotoolkit

/**
 * Returns {@code true} if the right edge of the bounding rectangle has been passed.
 *
 * @return {@code true} if the iteration over pixels is finished.
 */
@Override
public boolean finishedPixels() {
  boolean check = src.finishedPixels();
  if (check == dst.finishedPixels()) {
    return check;
  }
  throw new RasterFormatException(ERROR);
}

代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig

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();
}

代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig

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();
}

代码示例来源:origin: org.geotools/gt-process-raster

if(iterator.finishedPixels())
  throw new NoSuchElementException("Index beyond size:"+index+">"+size);
if(iterator.finishedLines())

代码示例来源:origin: org.geotools/gt-process-raster

public RasterAsPointFeatureIterator(final RasterAsPointFeatureCollection fc) {
  //checks
  Utilities.ensureNonNull("fc", fc);
  
  //get elements
  this.fc= fc;
  this.fb = new SimpleFeatureBuilder(fc.getSchema());
  this.size=fc.size;
  
  // create an iterator that only goes forward, it is the fastest one
  iterator= RectIterFactory.create(fc.gc2d.getRenderedImage(), null);
  //
  //start the iterator
  //
  iterator.startLines();
  if(iterator.finishedLines())
    throw new NoSuchElementException("Index beyond size:"+index+">"+size);
  iterator.startPixels();
  if(iterator.finishedPixels())
    throw new NoSuchElementException("Index beyond size:"+index+">"+size);   
  
  // appo
  temp= new double[fc.numBands];
}

代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig

while (!readIter.finishedPixels()) {
  final int val = readIter.getSample(0);
  if (!SSUtils.compareDouble(val, inputNoData)) {

代码示例来源:origin: org.jaitools/jt-contour

while (!iter.finishedLines()) {
  iter.startPixels();
  while (!iter.finishedPixels()) {
    double val = iter.getSampleDouble();
    if (!Double.isNaN(val)) {

代码示例来源:origin: com.googlecode.jaitools/jt-contour

while (!iter.finishedLines()) {
  iter.startPixels();
  while (!iter.finishedPixels()) {
    double val = iter.getSampleDouble();
    if (!Double.isNaN(val)) {

代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig

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();
  }
}

代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig

redIter.startPixels();
writerIter.startPixels();
while (!nirIter.finishedPixels() && !redIter.finishedPixels()
    && !writerIter.finishedPixels()) {
  double nir = nirIter.getSampleDouble(nirIndex);

代码示例来源:origin: Geomatys/geotoolkit

/**
 * 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());
}

代码示例来源:origin: Geomatys/geotoolkit

if (!e.finishedLines()) do {
  assertFalse(a.finishedLines());
  if (!e.finishedPixels()) do {
    assertFalse(a.finishedPixels());
    if (!e.finishedBands()) do {
      assertFalse(a.finishedBands());
    e.startBands();
  } while (!e.nextPixelDone());
  assertTrue(a.finishedPixels());
  a.nextLine();
  a.startPixels();

代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig

public GridCoverage2D execute(GridCoverage2D inputGc, double[] fuzzyValues) {
  DiskMemImage outputImage = this.createDiskMemImage(inputGc, RasterPixelType.FLOAT);
  PlanarImage inputImage = (PlanarImage) inputGc.getRenderedImage();
  final double inputNoData = RasterHelper.getNoDataValue(inputGc);
  this.NoData = RasterHelper.getDefaultNoDataValue(PixelType);
  RectIter inputIter = RectIterFactory.create(inputImage, inputImage.getBounds());
  WritableRectIter writerIter = RectIterFactory.createWritable(outputImage,
      outputImage.getBounds());
  inputIter.startLines();
  writerIter.startLines();
  while (!inputIter.finishedLines() && !writerIter.finishedLines()) {
    inputIter.startPixels();
    writerIter.startPixels();
    while (!inputIter.finishedPixels() && !writerIter.finishedPixels()) {
      final double inputVal = inputIter.getSampleDouble(0);
      if (SSUtils.compareDouble(inputNoData, inputVal)) {
        writerIter.setSample(0, NoData);
      } else {
        double fuzzyValue = getFuzzyValue(inputVal, fuzzyValues) * maxRange;
        writerIter.setSample(0, fuzzyValue);
        updateStatistics(inputVal);
      }
      inputIter.nextPixel();
      writerIter.nextPixel();
    }
    inputIter.nextLine();
    writerIter.nextLine();
  }
  return createGridCoverage("Fuzzy", outputImage);
}

代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig

inputIter.startPixels();
writerIter.startPixels();
while (!inputIter.finishedPixels() && !writerIter.finishedPixels()) {
  final double curVal = inputIter.getSampleDouble(bandIndex);

相关文章