float[][] bankData = dataBuffer.getBankData(); tileReader.getTile(readerTileX, readerTileY, bankData);
/** Extracts pixel data as arrays of floats, one per channel. */ public static float[][] getFloats(WritableRaster r, int x, int y, int w, int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_FLOAT, DataBufferFloat.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferFloat) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution int c = r.getNumBands(); float[][] samples = new float[c][w * h]; for (int i=0; i<c; i++) r.getSamples(x, y, w, h, i, samples[i]); return samples; }
/** Extracts pixel data as arrays of floats, one per channel. */ public static float[][] getFloats(WritableRaster r, int x, int y, int w, int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_FLOAT, DataBufferFloat.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferFloat) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution int c = r.getNumBands(); float[][] samples = new float[c][w * h]; for (int i=0; i<c; i++) r.getSamples(x, y, w, h, i, samples[i]); return samples; }
/** Extracts pixel data as arrays of floats, one per channel. */ public static float[][] getFloats(final WritableRaster r, final int x, final int y, final int w, final int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_FLOAT, DataBufferFloat.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferFloat) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution final int c = r.getNumBands(); final float[][] samples = new float[c][w * h]; for (int i = 0; i < c; i++) r.getSamples(x, y, w, h, i, samples[i]); return samples; }
/** Extracts pixel data as arrays of floats, one per channel. */ public static float[][] getFloats(WritableRaster r, int x, int y, int w, int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_FLOAT, DataBufferFloat.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferFloat) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution int c = r.getNumBands(); float[][] samples = new float[c][w * h]; for (int i=0; i<c; i++) r.getSamples(x, y, w, h, i, samples[i]); return samples; }
/** Extracts pixel data as arrays of floats, one per channel. */ public static float[][] getFloats(final WritableRaster r, final int x, final int y, final int w, final int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_FLOAT, DataBufferFloat.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferFloat) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution final int c = r.getNumBands(); final float[][] samples = new float[c][w * h]; for (int i = 0; i < c; i++) r.getSamples(x, y, w, h, i, samples[i]); return samples; }
ComponentSampleModel sampleModel = (ComponentSampleModel) latLonData.getSampleModel(); DataBufferFloat dataBuffer = (DataBufferFloat) latLonData.getDataBuffer(); float[][] bankData = dataBuffer.getBankData(); int sampleModelTranslateX = latLonData.getSampleModelTranslateX(); int sampleModelTranslateY = latLonData.getSampleModelTranslateY();
case DataBuffer.TYPE_FLOAT: { DataBufferFloat dataBuffer = (DataBufferFloat) currentTile.getDataBuffer(); float[][] bankData = dataBuffer.getBankData(); tileReader.getTile(readerTileX, readerTileY, bankData);
case DataBuffer.TYPE_FLOAT: float[][] fbuf = ((DataBufferFloat)currentTile.getDataBuffer()).getBankData(); for (int i = 0; i < fbuf.length; i++) iis.readFully(fbuf[i], 0, fbuf[i].length);
case DataBuffer.TYPE_FLOAT: float[][] fbuf = ((DataBufferFloat)currentTile.getDataBuffer()).getBankData(); for (int i = 0; i < fbuf.length; i++) iis.readFully(fbuf[i], 0, fbuf[i].length);
case DataBuffer.TYPE_FLOAT: float[][] fbuf = ((DataBufferFloat)currentTile.getDataBuffer()).getBankData(); for (int i = 0; i < fbuf.length; i++) iis.readFully(fbuf[i], 0, fbuf[i].length);
case DataBuffer.TYPE_FLOAT: final FloatDataBuffer.Builder fltBldr = FloatDataBuffer.newBuilder(); final float[][] fltBank = ((DataBufferFloat) dataBuffer).getBankData(); final Iterable<FloatArray> floatIt = () -> new Iterator<FloatArray>() { private int index = 0;