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

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

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

RectIter.startPixels介绍

暂无

代码示例

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

/** Sets the iterator to the leftmost pixel of its bounding rectangle. */
public void startPixels() {
  src.startPixels();
  dst.startPixels();
}

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

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

代码示例来源: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.nextLineDone()) iterator.startPixels();

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

int j = 0;
do {
  iter.startPixels();
  final boolean[] nodLine = hasNoData ? gaps[j] : null;
  final double[] row = samples[j++];

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

int j = 0;
do {
  iter.startPixels();
  final boolean[] nodLine = hasNoData ? gaps[j] : null;
  final float[] row = samples[j++];

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

/**
 * Sets the iterator to the leftmost pixel of its bounding rectangle.
 */
public void startPixels() {
  iterator.startPixels();
}

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

int j = 0;
do {
  iter.startPixels();
  final boolean[] nodLine = hasNoData ? gaps[j] : null;
  final int[] row = samples[j++];

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

/**
 * Sets the iterator to the leftmost pixel of its bounding rectangle.
 */
public void startPixels() {
  src.startPixels();
  dst.startPixels();
}

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

/**
 * Sets the iterator to the leftmost pixel of its bounding rectangle.
 */
public void startPixels() {
  src.startPixels();
  dst.startPixels();
}

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

/**
 * Sets the iterator to the leftmost pixel of its bounding rectangle.
 */
@Override
public void startPixels() {
  src.startPixels();
  dst.startPixels();
}

代码示例来源: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.jaitools/jt-utils

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

代码示例来源: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

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: geosolutions-it/jai-ext

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

代码示例来源:origin: geosolutions-it/jai-ext

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

代码示例来源:origin: geosolutions-it/jai-ext

iter.nextPixel();
iter.startPixels();
iter.nextLine();

代码示例来源: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());
}

相关文章