/** * Sets a sample in the specified band for the pixel located at (x,y) in the <code>DataBuffer * </code> using a <code>double</code> for input. <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 set. * @param s The input sample as a <code>double</code>. * @param data The <code>DataBuffer</code> containing the image data. * @throws <code>ArrayIndexOutOfBoundsException</code> if coordinates are not in bounds */ public void setSample(int x, int y, int b, double s, DataBuffer data) { data.setElemDouble(bankIndices[b], y * scanlineStride + x * pixelStride + bandOffsets[b], s); }
/** * @inheritDoc */ @Override public void setSample(int x, int y, int b, double s, DataBuffer data) { checkBounds(x, y); data.setElemDouble(y * width + x, s); }
/** * Creates a new raster containing solely no-data (non-interpretable data, missing data) samples. The raster's * data buffer is filled with the given no-data value. * <p/> * The raster's origin is (0, 0). In order to translate the raster, * use {@link Raster#createTranslatedChild(int x, int y)}. * * @param noDataValue The no-data value used to fill the data buffer * of the raster created. * @return the raster created. * @see {@link NoDataRaster}. */ protected NoDataRaster createNoDataRaster(double noDataValue) { final Raster raster = createWritableRaster(getSampleModel(), new Point(0, 0)); final DataBuffer buffer = raster.getDataBuffer(); for (int i = 0; i < buffer.getSize(); i++) { buffer.setElemDouble(i, noDataValue); } return new NoDataRaster(raster); }
data.setElemDouble(bankIndices[i], pixelOffset + bandOffsets[i], darray[i]);