Example usage for java.awt.image ComponentSampleModel getHeight

List of usage examples for java.awt.image ComponentSampleModel getHeight

Introduction

In this page you can find the example usage for java.awt.image ComponentSampleModel getHeight.

Prototype

public final int getHeight() 

Source Link

Document

Returns the height in pixels.

Usage

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;/*from   ww w. j  a  v  a 2s.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;
}