/** * Returns the sample in a specified band for the pixel located at (x,y) as a <code>float</code> * . <code>ArrayIndexOutOfBoundsException</code> may be thrown if the coordinates are not in * bounds. * * @param x The X coordinate of the pixel location. * @param y The Y coordinate of the pixel location. * @param b The band to return. * @param data The <code>DataBuffer</code> containing the image data. * @return sample The floating point sample value * @throws <code>ArrayIndexOutOfBoundsException</code> if coordinates are not in bounds */ public float getSampleFloat(int x, int y, int b, DataBuffer data) { float sample = data.getElemFloat(bankIndices[b], y * scanlineStride + x * pixelStride + bandOffsets[b]); return sample; }
/** * @inheritDoc */ @Override public float getSampleFloat(int x, int y, int b, DataBuffer data) { checkBounds(x, y); return data.getElemFloat(y * width + x); }
int pos = 2 * (y * (xNumCells + 1) + x); int idx = y * xNumCells + x; warpPositions[pos] = dyBuffer.getElemFloat(idx);// dx.getData().getSampleFloat(x, y, 0); warpPositions[pos + 1] = dxBuffer.getElemFloat(idx);//dy.getData().getSampleFloat(x, y, 0);
elem = buffer.getElem(index); } else if (type == DataBuffer.TYPE_FLOAT) { elem = buffer.getElemFloat(index); } else if (type == DataBuffer.TYPE_DOUBLE) { elem = buffer.getElemDouble(index); elem = buffer.getElem(index); } else if (type == DataBuffer.TYPE_FLOAT) { elem = buffer.getElemFloat(index); } else if (type == DataBuffer.TYPE_DOUBLE) { elem = buffer.getElemDouble(index);
fdata[i] = data.getElemFloat(bankIndices[i], pixelOffset + bandOffsets[i]);
float[] array = new float[mosaicOp.getWidth()* mosaicOp.getHeight()]; for (int i = 0; i< mosaicOp.getWidth()* mosaicOp.getHeight(); i++) { array[i] = dataBuffer.getElemFloat(i);
@Override protected void computeRect(PlanarImage[] sources, WritableRaster dest, Rectangle destRect) { for (int y = 0; y < destRect.height; y++) { for (int x = 0; x < destRect.width; x++) { if (dataBuffer.getDataType() == DataBuffer.TYPE_FLOAT) { dest.setSample(x, y, 0, dataBuffer.getElemFloat(y * destRect.width + x)); } else if (dataBuffer.getDataType() == DataBuffer.TYPE_DOUBLE) { dest.setSample(x, y, 0, dataBuffer.getElemDouble(y * destRect.width + x)); } else { dest.setSample(x, y, 0, dataBuffer.getElem(y * destRect.width + x)); } } } } }
break; destBuffer.setElemFloatAt(i, dataBuffer.getElemFloat(i));