Example usage for java.awt.image DirectColorModel getNumComponents

List of usage examples for java.awt.image DirectColorModel getNumComponents

Introduction

In this page you can find the example usage for java.awt.image DirectColorModel getNumComponents.

Prototype

public int getNumComponents() 

Source Link

Document

Returns the number of components, including alpha, in this ColorModel .

Usage

From source file:BlendCompositeDemo.java

private static boolean checkComponentsOrder(ColorModel cm) {
    if (cm instanceof DirectColorModel && cm.getTransferType() == DataBuffer.TYPE_INT) {
        DirectColorModel directCM = (DirectColorModel) cm;

        return directCM.getRedMask() == 0x00FF0000 && directCM.getGreenMask() == 0x0000FF00
                && directCM.getBlueMask() == 0x000000FF
                && (directCM.getNumComponents() != 4 || directCM.getAlphaMask() == 0xFF000000);
    }//from   w  w  w.  java2  s  . com

    return false;
}