本文整理了Java中javax.media.jai.iterator.RandomIter.getSample
方法的一些代码示例,展示了RandomIter.getSample
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RandomIter.getSample
方法的具体详情如下:
包路径:javax.media.jai.iterator.RandomIter
类名称:RandomIter
方法名:getSample
暂无
代码示例来源:origin: geotools/geotools
public int getSample(int x, int y, int b) {
return delegate.getSample(x, y, b);
}
代码示例来源:origin: geotools/geotools
int value = iter.getSample(x, y, 0);
代码示例来源:origin: geotools/geotools
private boolean inROI(int x, int y, RandomIter roiIter, boolean roiContainsTile) {
if (hasROI) {
if (roiContainsTile) {
return true;
}
if (!roiBounds.contains(x, y)) {
return false;
} else {
final int sample = roiIter.getSample(x, y, 0);
return sample > 0;
}
} else {
return true;
}
}
代码示例来源:origin: geotools/geotools
int col = (tileX * tileWidth) + tcol;
if ((col >= minX) && (col <= maxX)) {
int value = iter.getSample(col, row, 0);
if (!bitSet.get(col - minX, row - minY)) {
if (value == I_VALUE) {
代码示例来源:origin: geotools/geotools
for (int y : yvals) {
for (int x = imageProperties.minX; x <= imageProperties.maxX; x++) {
int value = iter.getSample(x, y, 0);
if (value != refValue) {
return false;
for (int x : xvals) {
for (int y = imageProperties.minY; y <= imageProperties.maxY; y++) {
int value = iter.getSample(x, y, 0);
if (value != refValue) {
return false;
代码示例来源:origin: it.geosolutions.jaiext.jiffle/jt-jiffle-language
if (roiIterator != null && (roiIterator.getSample(posx, posy, 0) & 0xff) == 0) {
return Double.NaN;
代码示例来源:origin: geotools/geotools
y += (imageProperties.maxY - imageProperties.minY)) {
for (int x = imageProperties.minX; x <= imageProperties.maxX; x++) {
double value = iter.getSample(x, y, 0);
if (value != refValue) {
return false;
y <= imageProperties.maxY;
y += (imageProperties.maxY - imageProperties.minY)) {
double value = iter.getSample(x, y, 0);
if (value != refValue) {
return false;
代码示例来源:origin: geosolutions-it/jai-ext
if (roiIterator != null && (roiIterator.getSample(posx, posy, 0) & 0xff) == 0) {
return Double.NaN;
代码示例来源:origin: org.geotools/gt-imagemosaic
/**
*
* @param roiAccessor
* @param x
* @param y
* @return
*/
private final static boolean contains(RoiAccessor roiAccessor, int x, int y) {
return (x >= roiAccessor.minX && x < roiAccessor.minX + roiAccessor.w)
&& (y >= roiAccessor.minY && y < roiAccessor.minY + roiAccessor.h)
&& (roiAccessor.iterator.getSample(x, y, 0) >= 1);
}
代码示例来源:origin: geosolutions-it/jai-ext
/**
*
* @param roiAccessor
* @param x
* @param y
* @return
*/
private final boolean contains(RoiAccessor roiAccessor, int x, int y) {
return (x >= roiAccessor.minX && x < roiAccessor.minX + roiAccessor.w)
&& (y >= roiAccessor.minY && y < roiAccessor.minY + roiAccessor.h)
&& (roiAccessor.iterator.getSample(x, y, 0) >= 1);
}
代码示例来源:origin: it.geosolutions.jaiext.errordiffusion/jt-errordiffusion
/**
* Private method for checking if a pixel in position (x,y) is inside the ROI
*
* @param roiIter
* @param y
* @param x
* @return true if the pixel is inside ROI
*/
private boolean inROI(RandomIter roiIter, int y, int x) {
return (roiBounds.contains(x, y) && roiIter.getSample(x, y, 0) > 0);
}
代码示例来源:origin: geosolutions-it/jai-ext
/**
* Private method for checking if a pixel in position (x,y) is inside the ROI
*
* @param roiIter
* @param y
* @param x
* @return true if the pixel is inside ROI
*/
private boolean inROI(RandomIter roiIter, int y, int x) {
return (roiBounds.contains(x, y) && roiIter.getSample(x, y, 0) > 0);
}
代码示例来源:origin: geotools/geotools
for (int row = overlapArea.y; row < maxRow; row++) {
for (int col = overlapArea.x; col < maxCol; col++) {
int maskValue = sourceIter.getSample(col, row, 0);
int rasValue = rasterIter.getSample(col, row, 0);
if (maskValue == 1 && rasValue == 0) {
代码示例来源:origin: geotools/geotools
for (int i = 0; i < kwidth; i++) {
samples[j][i] =
iter.getSample(xint + i, yint + j, b) & 0xFF;
for (int i = 0; i < kwidth; i++) {
samples[j][i] =
t[iter.getSample(xint + i, yint + j, 0) & 0xFF]
& 0xFF;
代码示例来源:origin: geotools/geotools
for (int j = 0; j < kheight; j++) {
for (int i = 0; i < kwidth; i++) {
samples[j][i] = iter.getSample(xint + i, yint + j, b);
代码示例来源:origin: geotools/geotools
for (int j = 0; j < kheight; j++) {
for (int i = 0; i < kwidth; i++) {
samples[j][i] = iter.getSample(xint + i, yint + j, b) & 0xFFFF;
代码示例来源:origin: geotools/geotools
for (int j = 0; j < kheight; j++) {
for (int i = 0; i < kwidth; i++) {
samples[j][i] = iter.getSample(xint + i, yint + j, b);
代码示例来源:origin: geosolutions-it/jai-ext
public int[][] roiBoundCheck(int dataType, Number[][] pixelArray, int[][] weightArray,
boolean bilinearUsed) {
int x0 = src[dataType].getX() + posx / src[dataType].getPixelStride();
int y0 = src[dataType].getY() + (posy - src[dataType].getBandOffset(0))
/ src[dataType].getScanlineStride();
// get the 4/16 weight
if (roiBounds.contains(x0, y0)) {
for (int i = 0; i < pixelArray.length; i++) {
for (int j = 0; j < pixelArray.length; j++) {
if (bilinearUsed) {
weightArray[i][j] = roiIter.getSample(x0 + j, y0 + i, 0);
} else {
weightArray[i][j] = roiIter.getSample(x0 + (j - 1), y0 + (i - 1), 0);
}
}
}
}
return weightArray;
}
代码示例来源:origin: geosolutions-it/jai-ext
/** Method for testing the selected input RandomIter on an Integral image */
public void testRandomIterInt(RenderedImage img, int[] valueArray, boolean cachedTiles,
boolean arrayCalculation) {
RandomIter iter = RandomIterFactory.create(img, null, cachedTiles, arrayCalculation);
int[] array = new int[3];
// Store of the image data calculated
for (int i = 0; i < indexArray.length; i++) {
int x = indexArray[i][0];
int y = indexArray[i][1];
int valueExpected = iter.getSample(x, y, 0);
assertEquals(valueExpected, valueArray[i]);
int valueExpectedArray = iter.getPixel(x, y, array)[0];
assertEquals(valueExpectedArray, valueArray[i]);
}
}
代码示例来源:origin: geosolutions-it/jai-ext
@Test
public void builderCreatesDestImage() throws Exception {
System.out.println(" builder creating dest image");
String script = "init { n = 0; } dest = n++ ;" ;
jb.dest("dest", IMG_WIDTH, IMG_WIDTH).script(script).getRuntime().evaluateAll(null);
RenderedImage img = jb.getImage("dest");
assertNotNull(img);
RandomIter iter = RandomIterFactory.create(img, null);
int k = 0;
for (int y = 0; y < IMG_WIDTH; y++) {
for (int x = 0; x < IMG_WIDTH; x++) {
assertEquals(k, iter.getSample(x, y, 0));
k++ ;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!