Package java.awt.image

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


       
        // 1.5 second vs 0.3 second
//        long start = System.currentTimeMillis();
        image = changeImageWidth(image, image.getWidth() / 2);
        ConvolveOp gaussianFilter = getGaussianBlurFilter(BLUR_SIZE, true);
        image = gaussianFilter.filter(image, null);
        gaussianFilter = getGaussianBlurFilter(BLUR_SIZE, false);
        image = gaussianFilter.filter(image, null);
        ColorTintFilter colorMixFilter = new ColorTintFilter(Color.WHITE, 0.4f);
        image = colorMixFilter.filter(image, null);
        image = changeImageWidth(image, image.getWidth() * 2);
 
View Full Code Here


//        long start = System.currentTimeMillis();
        image = changeImageWidth(image, image.getWidth() / 2);
        ConvolveOp gaussianFilter = getGaussianBlurFilter(BLUR_SIZE, true);
        image = gaussianFilter.filter(image, null);
        gaussianFilter = getGaussianBlurFilter(BLUR_SIZE, false);
        image = gaussianFilter.filter(image, null);
        ColorTintFilter colorMixFilter = new ColorTintFilter(Color.WHITE, 0.4f);
        image = colorMixFilter.filter(image, null);
        image = changeImageWidth(image, image.getWidth() * 2);
//        System.out.println("time = " +
//                           ((System.currentTimeMillis() - start) / 1000.0f));
View Full Code Here

    harness.checkPoint("testRaster1()");
    Raster src = createRasterA();
    WritableRaster dest = src.createCompatibleWritableRaster();
    Kernel k1 = new Kernel(1, 1, new float[] {1});
    ConvolveOp op = new ConvolveOp(k1, ConvolveOp.EDGE_ZERO_FILL, null);
    dest = op.filter(src, dest);
    harness.check(dest.getSample(0, 0, 0), 1);
    harness.check(dest.getSample(1, 0, 0), 2);
    harness.check(dest.getSample(2, 0, 0), 3);
    harness.check(dest.getSample(3, 0, 0), 4);
    harness.check(dest.getSample(4, 0, 0), 5);
View Full Code Here

    WritableRaster dest = src.createCompatibleWritableRaster();
    Kernel k1 = new Kernel(3, 3, new float[] {0,0,0,
                                              0,1,0,
                                              0,0,0});
    ConvolveOp op = new ConvolveOp(k1, ConvolveOp.EDGE_ZERO_FILL, null);
    dest = op.filter(src, dest);
    harness.check(dest.getSample(0, 0, 0), 0);
    harness.check(dest.getSample(1, 0, 0), 0);
    harness.check(dest.getSample(2, 0, 0), 0);
    harness.check(dest.getSample(3, 0, 0), 0);
    harness.check(dest.getSample(4, 0, 0), 0);
View Full Code Here

    WritableRaster dest = src.createCompatibleWritableRaster();
    Kernel k1 = new Kernel(3, 3, new float[] {0.1f,0.2f,0.3f,
                                              0.4f,0.5f,0.6f,
                                              0.7f,0.8f,0.9f});
    ConvolveOp op = new ConvolveOp(k1, ConvolveOp.EDGE_NO_OP, null);
    dest = op.filter(src, dest);
    harness.check(dest.getSample(0, 0, 0), 1);
    harness.check(dest.getSample(1, 0, 0), 2);
    harness.check(dest.getSample(2, 0, 0), 3);
    harness.check(dest.getSample(3, 0, 0), 4);
    harness.check(dest.getSample(4, 0, 0), 5);
View Full Code Here

    ConvolveOp op = new ConvolveOp(k1, ConvolveOp.EDGE_ZERO_FILL, null);
   
    // Src and dst images cannot be the same
    try
    {
      op.filter(img, img);
      harness.check(false);
    }
    catch (IllegalArgumentException e)
    {
      harness.check(true);
View Full Code Here

   
    // Src and dst are different sizes (allowed)
    BufferedImage dst = new BufferedImage(30, 40, BufferedImage.TYPE_USHORT_GRAY);
    try
    {
      op.filter(img, dst);
      harness.check(true);
    }
    catch (IllegalArgumentException e)
    {
      harness.check(false);
View Full Code Here

    Kernel k1 = new Kernel(3, 3, new float[] {0.2f,0.3f,0.5f,
                                              0.4f,0.6f,0.7f,
                                              0.6f,0.9f,0.8f});
    ConvolveOp op = new ConvolveOp(k1, ConvolveOp.EDGE_ZERO_FILL, null);
   
    BufferedImage dst = op.filter(img, null);
    WritableRaster dest = dst.getRaster();
   
    harness.check(img.isAlphaPremultiplied(), false);
    harness.check(dst.isAlphaPremultiplied(), false);
   
View Full Code Here

                                              0.6f,0.9f,0.8f});
    ConvolveOp op = new ConvolveOp(k1, ConvolveOp.EDGE_ZERO_FILL, null);
   
    BufferedImage dst = new BufferedImage(5, 5, BufferedImage.TYPE_INT_ARGB);
   
    dst = op.filter(img, dst);
    WritableRaster dest = dst.getRaster();
   
    harness.check(img.isAlphaPremultiplied(), true);
    harness.check(dst.isAlphaPremultiplied(), false);
View Full Code Here

          new BufferedImage(
            image.getWidth(),
            image.getHeight(),
            image.getType());

        simpleBlur.filter(image, (BufferedImage) destination);

        //destination = destination.getSubimage(blurRadius/2, blurRadius/2, image.getWidth(), image.getHeight());
        g2 = (Graphics2D) destination.getGraphics();
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, antialiasSetting);
        renderedImage = (RenderedImage) destination;
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.