List of usage examples for java.awt.image BandCombineOp BandCombineOp
public BandCombineOp(float[][] matrix, RenderingHints hints)
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 }