double[][] bankData = dataBuffer.getBankData(); tileReader.getTile(readerTileX, readerTileY, bankData);
/** Extracts pixel data as arrays of doubles, one per channel. */ public static double[][] getDoubles(WritableRaster r, int x, int y, int w, int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_DOUBLE, DataBufferDouble.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferDouble) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution int c = r.getNumBands(); double[][] samples = new double[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 doubles, one per channel. */ public static double[][] getDoubles(WritableRaster r, int x, int y, int w, int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_DOUBLE, DataBufferDouble.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferDouble) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution int c = r.getNumBands(); double[][] samples = new double[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 doubles, one per channel. */ public static double[][] getDoubles(WritableRaster r, int x, int y, int w, int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_DOUBLE, DataBufferDouble.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferDouble) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution int c = r.getNumBands(); double[][] samples = new double[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 doubles, one per channel. */ public static double[][] getDoubles(final WritableRaster r, final int x, final int y, final int w, final int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_DOUBLE, DataBufferDouble.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferDouble) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution final int c = r.getNumBands(); final double[][] samples = new double[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 doubles, one per channel. */ public static double[][] getDoubles(final WritableRaster r, final int x, final int y, final int w, final int h) { if (canUseBankDataDirectly(r, DataBuffer.TYPE_DOUBLE, DataBufferDouble.class) && x == 0 && y == 0 && w == r.getWidth() && h == r.getHeight()) { return ((DataBufferDouble) r.getDataBuffer()).getBankData(); } // NB: an order of magnitude faster than the naive makeType solution final int c = r.getNumBands(); final double[][] samples = new double[c][w * h]; for (int i = 0; i < c; i++) r.getSamples(x, y, w, h, i, samples[i]); return samples; }
case DataBuffer.TYPE_DOUBLE: { DataBufferDouble dataBuffer = (DataBufferDouble) currentTile.getDataBuffer(); double[][] bankData = dataBuffer.getBankData(); tileReader.getTile(readerTileX, readerTileY, bankData);
case DataBuffer.TYPE_DOUBLE: double[][] dbuf = ((DataBufferDouble)currentTile.getDataBuffer()).getBankData(); for (int i = 0; i < dbuf.length; i++) iis.readFully(dbuf[i], 0, dbuf[i].length);
case DataBuffer.TYPE_DOUBLE: double[][] dbuf = ((DataBufferDouble)currentTile.getDataBuffer()).getBankData(); for (int i = 0; i < dbuf.length; i++) iis.readFully(dbuf[i], 0, dbuf[i].length);
case DataBuffer.TYPE_DOUBLE: double[][] dbuf = ((DataBufferDouble)currentTile.getDataBuffer()).getBankData(); for (int i = 0; i < dbuf.length; i++) iis.readFully(dbuf[i], 0, dbuf[i].length);
case DataBuffer.TYPE_DOUBLE: final DoubleDataBuffer.Builder dblBldr = DoubleDataBuffer.newBuilder(); final double[][] dblBank = ((DataBufferDouble) dataBuffer).getBankData(); final Iterable<DoubleArray> dblIt = () -> new Iterator<DoubleArray>() { private int index = 0;