Example usage for java.awt.image BandCombineOp BandCombineOp

List of usage examples for java.awt.image BandCombineOp BandCombineOp

Introduction

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

Prototype

public BandCombineOp(float[][] matrix, RenderingHints hints) 

Source Link

Document

Constructs a BandCombineOp with the specified matrix.

Usage

From source file:Java2DExample.java

public BufferedImage processImage(BufferedImage image) {
    float[][] colorMatrix = { { 1f, 0f, 0f }, { 0.5f, 1.0f, 0.5f }, { 0.2f, 0.4f, 0.6f } };
    BandCombineOp changeColors = new BandCombineOp(colorMatrix, null);
    Raster sourceRaster = image.getRaster();
    WritableRaster displayRaster = sourceRaster.createCompatibleWritableRaster();
    changeColors.filter(sourceRaster, displayRaster);
    return new BufferedImage(image.getColorModel(), displayRaster, true, null);

}

From source file:CombineApp.java

public void bandCombine(float[][] bandCombineMatrix) {
    BandCombineOp bandCombineOp = new BandCombineOp(bandCombineMatrix, null);
    bandCombineOp.filter(srcRaster, dstRaster);
    bi = biDest;//w  ww .ja  va 2  s  .  co m
}