Package java.awt.image

Examples of java.awt.image.BandCombineOp.filter()


                matrix[0][0] = 1;
            }

            Raster srcRas = src.getData(wr.getBounds());
            BandCombineOp op = new BandCombineOp(matrix, null);
            op.filter(srcRas, wr);
        } else {
            Raster         srcRas = src.getData(wr.getBounds());
            WritableRaster srcWr  = (WritableRaster)srcRas;

            // Divide out alpha if we have it.  We need to do this since
View Full Code Here


                dstBI = new BufferedImage(cmna, dstWr, false, null);
            }

            ColorConvertOp op = new ColorConvertOp(null);
            op.filter(srcBI, dstBI);

            // I never have to 'fix' alpha premult since I take
            // it's value from my source....
            if (dstCM.hasAlpha())
                copyBand(srcWr, sm.getNumBands()-1,
View Full Code Here

                matrix[3][3] = 1; // Alpha
                break;
            }
            Raster srcRas = src.getData(wr.getBounds());
            BandCombineOp op = new BandCombineOp(matrix, null);
            op.filter(srcRas, wr);
            return wr;
        }

        if (srcCM.getColorSpace() ==
            ColorSpace.getInstance(ColorSpace.CS_GRAY)) {
View Full Code Here

                matrix[4][1] = 1; // Alpha
                break;
            }
            Raster srcRas = src.getData(wr.getBounds());
            BandCombineOp op = new BandCombineOp(matrix, null);
            op.filter(srcRas, wr);
            } catch (Throwable t) {
                t.printStackTrace();
            }
            return wr;
        }
View Full Code Here

        // System.out.println("src: " + srcBI.getWidth() + "x" +
        //                    srcBI.getHeight());

        ColorConvertOp op = new ColorConvertOp(dstCM.getColorSpace(),
                                               null);
        dstBI = op.filter(srcBI, null);

        // System.out.println("After filter:");

        WritableRaster wr00 = wr.createWritableTranslatedChild(0,0);
        for (int i=0; i<dstCM.getColorSpace().getNumComponents(); i++)
View Full Code Here

                break;
            }

            Raster srcRas = src.getData(wr.getBounds());
            BandCombineOp op = new BandCombineOp(matrix, null);
            op.filter(srcRas, wr);
        } else {
            ColorModel dstCM = getColorModel();
            BufferedImage dstBI;

            if (!dstCM.hasAlpha()) {
View Full Code Here

             * System.out.println("dst: " + dstBI.getWidth() + "x" +
             *                    dstBI.getHeight());
             */

            ColorConvertOp op = new ColorConvertOp(null);
            op.filter(srcBI, dstBI);

            if (dstCM.hasAlpha())
                copyBand(srcWr, srcSM.getNumBands()-1,
                         wr,    getSampleModel().getNumBands()-1);
        }
View Full Code Here

   
   
    // Basic checks on output
    BandCombineOp op = new BandCombineOp(matrix, null);
    WritableRaster dst2 = op.createCompatibleDestRaster(src);
    WritableRaster dst = op.filter(src, dst2);
    harness.check(dst, dst2);
    harness.check(dst.getNumBands(), 2);
   
    // A null dst2 should also work
    dst2 = null;
View Full Code Here

    harness.check(dst, dst2);
    harness.check(dst.getNumBands(), 2);
   
    // A null dst2 should also work
    dst2 = null;
    dst = op.filter(src, dst2);
    harness.check(dst instanceof WritableRaster);
    harness.check(dst2, null);
   
    // Check first band
    int[] pixels = dst.getSamples(0, 0, 5, 5, 0, (int[])null);
View Full Code Here

    // there is one more column in the matrix than there are bands
    // And throw in a check with negative numbers too... why not =)
    matrix = new float[][] {{2, -7, 5},
                            {5, 6, -3}};
    op = new BandCombineOp(matrix, null);
    dst = op.filter(src, dst);
   
    // First band
    pixels = dst.getSamples(0, 0, 5, 5, 0, (int[])null);
    Arrays.fill(expected, 5);
    expected[7] = 130;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.