Package java.awt.image

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


                        this.TRANSFORMACIONES[transf + 1]);
                ConvolveOp cop2 = new ConvolveOp(kernel2, ConvolveOp.EDGE_NO_OP, null);
                BufferedImage aux2 = new BufferedImage(this.imagenSinModificar.getWidth(),
                        this.imagenSinModificar.getHeight(),
                        this.imagenSinModificar.getType());
                cop2.filter(this.imagenTransformada, aux2);
                this.imagenTransformada = aux2;
            }

            //Llamamos al brillo para que se le sume el brillo a la imagen dejando intacta
            //la de transformaciones
View Full Code Here


        float n = 1f / 25f;
        Kernel kernel = new Kernel(5, 5, new float[] { n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n,
                n, n, n, n });

        ConvolveOp op = new ConvolveOp(kernel);
        op.filter(bi, buff);

        return buff;
    }

    public BufferedImage filterNoise(BufferedImage bi) {
View Full Code Here

        float n = 1f / 25f;
        Kernel kernel = new Kernel(5, 5, new float[] { n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n,
                n, n, n, n });

        ConvolveOp op = new ConvolveOp(kernel);
        op.filter(bi, buff);

        return buff;
    }

}
View Full Code Here

        gb.setClip(new RoundRectangle2D.Float(INSET + HIGHLIGHT_INSET, INSET + HIGHLIGHT_INSET, highlightWidth, highlightHeight / 2, highlightHeight / 3, highlightHeight / 3));
        gb.fillRoundRect(INSET + HIGHLIGHT_INSET, INSET + HIGHLIGHT_INSET, highlightWidth, highlightHeight, highlightArc, highlightArc);

        // Blur
        ConvolveOp blurOp = new ConvolveOp(new Kernel(3, 3, BLUR));
        BufferedImage blurredImage = blurOp.filter(buffer, null);

        // Draw button
        g2.drawImage(blurredImage, 0, 0, null);

        // Draw the text (if any)
View Full Code Here

            gb.setClip(new RoundRectangle2D.Float(INSET, INSET, highlightWidth, highlightHeight, highlightArc, highlightArc));
            gb.fillRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);

            // Blur
            ConvolveOp blurOp = new ConvolveOp(new Kernel(3, 3, BLUR));
            BufferedImage blurredImage = blurOp.filter(buffer, null);

            // Draw button
            g2.drawImage(blurredImage, 1, 1, null);
        }
        // Draw the text (if any)
View Full Code Here

                gb.setClip(new RoundRectangle2D.Float(INSET, INSET, highlightWidth, highlightHeight, highlightArc, highlightArc));
                gb.fillRoundRect(INSET, INSET, buttonWidth, buttonHeight, arc, arc);

                // Blur
                ConvolveOp blurOp = new ConvolveOp(new Kernel(3, 3, BLUR));
                BufferedImage blurredImage = blurOp.filter(buffer, null);

                // Draw button
                g2.drawImage(blurredImage, 1, 1, null);
            }
            // Draw the text (if any)
View Full Code Here

        gb.setClip(new Ellipse2D.Float(INSET + HIGHLIGHT_INSET, INSET + HIGHLIGHT_INSET, highlightWidth, highlightHeight / 2));
        gb.fillOval(INSET + HIGHLIGHT_INSET, INSET + HIGHLIGHT_INSET, highlightWidth, highlightHeight);

        // Blur
        ConvolveOp blurOp = new ConvolveOp(new Kernel(3, 3, BLUR));
        BufferedImage blurredImage = blurOp.filter(buffer, null);

        // Draw button
        g2.drawImage(blurredImage, 0, 0, null);

        //draw icon
View Full Code Here

    ConvolveOp gaussianOp1 = new ConvolveOp(gaussianBlur1, ConvolveOp.EDGE_NO_OP, hints);
    ConvolveOp gaussianOp2 = new ConvolveOp(gaussianBlur2, ConvolveOp.EDGE_NO_OP, hints);
    BufferedImage scratchImage = EffectUtil.getScratchImage();
    for (int i = 0; i < blurPasses; i++) {
      gaussianOp1.filter(image, scratchImage);
      gaussianOp2.filter(scratchImage, image);
    }
  }

  public Color getColor () {
    return color;
View Full Code Here

      }

      Kernel kernel = new Kernel(blurWidth, blurWidth, elements);
      ConvolveOp simpleBlur = new ConvolveOp(kernel);

      simpleBlur.filter(bufferedImage, newImage);
      bufferedImage = newImage;
      dirty = true;
      return this;
   }
View Full Code Here

    private static void crashTest() {
        Raster src = createSrcRaster();
        WritableRaster dst = createDstRaster();
        ConvolveOp op = createConvolveOp(ConvolveOp.EDGE_NO_OP);
        try {
            op.filter(src, dst);
        } catch (ImagingOpException e) {
            /*
             * The test pair of source and destination rasters
             * may cause failure of the medialib convolution routine,
             * so this exception is expected.
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.