List of usage examples for java.awt.image ComponentSampleModel getWidth
public final int getWidth()
From source file:org.geoserver.jai.ConcurrentTileFactory.java
static long getBufferSizeCSM(ComponentSampleModel csm) { int[] bandOffsets = csm.getBandOffsets(); int maxBandOff = bandOffsets[0]; for (int i = 1; i < bandOffsets.length; i++) maxBandOff = Math.max(maxBandOff, bandOffsets[i]); long size = 0; if (maxBandOff >= 0) size += maxBandOff + 1;// ww w .jav a2s . c o m int pixelStride = csm.getPixelStride(); if (pixelStride > 0) size += pixelStride * (csm.getWidth() - 1); int scanlineStride = csm.getScanlineStride(); if (scanlineStride > 0) size += scanlineStride * (csm.getHeight() - 1); return size; }