Example usage for java.awt.image DirectColorModel getAlphaMask

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

Introduction

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

Prototype

public final int getAlphaMask() 

Source Link

Document

Returns the mask indicating which bits in an int pixel representation contain the alpha component.

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);
    }//www.j a  v a2  s . co  m

    return false;
}