Example usage for java.awt.image IndexColorModel getComponentSize

List of usage examples for java.awt.image IndexColorModel getComponentSize

Introduction

In this page you can find the example usage for java.awt.image IndexColorModel getComponentSize.

Prototype

public int getComponentSize(int componentIdx) 

Source Link

Document

Returns the number of bits for the specified color/alpha component.

Usage

From source file:org.apache.fop.render.pdf.ImageRenderedAdapter.java

/** {@inheritDoc} */
public int getBitsPerComponent() {
    ColorModel cm = getEffectiveColorModel();
    if (cm instanceof IndexColorModel) {
        IndexColorModel icm = (IndexColorModel) cm;
        return icm.getComponentSize(0);
    } else {//from  w  ww  .j ava  2  s .c o m
        return cm.getComponentSize(0);
    }
}