Example usage for java.awt.image BufferedImage isAlphaPremultiplied

List of usage examples for java.awt.image BufferedImage isAlphaPremultiplied

Introduction

In this page you can find the example usage for java.awt.image BufferedImage isAlphaPremultiplied.

Prototype

public boolean isAlphaPremultiplied() 

Source Link

Document

Returns whether or not the alpha has been premultiplied.

Usage

From source file:org.jtrfp.trcl.core.ResourceManager.java

private BufferedImage[] getSpecialRAWImage(String name, Color[] palette, int upscalePowerOfTwo)
        throws IllegalAccessException, FileLoadException, IOException {
    RAWFile dat = getRAW(name);//from   w ww  .ja  va2  s. c o  m
    dat.setPalette(palette);
    BufferedImage[] segs = dat.asSegments(upscalePowerOfTwo);
    for (BufferedImage seg : segs) {
        Graphics g = seg.getGraphics();
        BufferedImage scaled = new BufferedImage(seg.getColorModel(), seg.copyData(null),
                seg.isAlphaPremultiplied(), null);
        g.drawImage(
                scaled.getScaledInstance(seg.getWidth() - 2, seg.getHeight() - 2, Image.SCALE_AREA_AVERAGING),
                1, 1, seg.getWidth() - 2, seg.getHeight() - 2, null);
        g.dispose();
    }
    return segs;
}