List of usage examples for java.awt.image BandCombineOp filter
public WritableRaster filter(Raster src, WritableRaster dst)
From source file:CombineApp.java
public void bandCombine(float[][] bandCombineMatrix) { BandCombineOp bandCombineOp = new BandCombineOp(bandCombineMatrix, null); bandCombineOp.filter(srcRaster, dstRaster); bi = biDest;/*w w w .ja v a 2s. c om*/ }
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); }