Package java.awt.image

Examples of java.awt.image.ConvolveOp


        gb.setPaint(new GradientPaint(0, INSET + HIGHLIGHT_INSET, topColoring, 0, INSET + HIGHLIGHT_INSET + (highlightHeight / 2), backgroundColor.brighter(), false));
        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.setColor(buttonColor);
            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.setColor(canvas.getColor());
                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.setPaint(new GradientPaint(0, INSET + HIGHLIGHT_INSET, topColoring, 0, INSET + HIGHLIGHT_INSET + (highlightHeight / 2), backgroundColor.brighter(), false));
        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

  private void blur (BufferedImage image) {
    float[] matrix = GAUSSIAN_BLUR_KERNELS[blurKernelSize - 1];
    Kernel gaussianBlur1 = new Kernel(matrix.length, 1, matrix);
    Kernel gaussianBlur2 = new Kernel(1, matrix.length, matrix);
    RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
    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);
    }
  }
View Full Code Here

    float[] data = new float[size * size];
    float value = 1 / (float)(size * size);
    for (int i = 0; i < data.length; i++)
      data[i] = value;
   
    return new ConvolveOp(new Kernel(size, size, data));
  }
View Full Code Here

      for (int i = 0; i < pixels; i++) {
            elements[i] = weight;
      }

      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

    BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(),
        bi.getType());

    Kernel kernel = new Kernel(1, 1, new float[] { value });

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

    return buff;
  }
View Full Code Here

        int size = kw * kh;
        float[] kdata = new float[size];
        Arrays.fill(kdata, 1.0f / size);

        Kernel k  = new Kernel(kw, kh, kdata);
        return new ConvolveOp(k);
    }
View Full Code Here

        final Kernel kernel = new Kernel(3, 3,
                new float[] {
            1f/9f, 1f/9f, 1f/9f,
            1f/9f, 1f/9f, 1f/9f,
            1f/9f, 1f/9f, 1f/9f});
        op = new ConvolveOp(kernel);
    }
View Full Code Here

TOP

Related Classes of java.awt.image.ConvolveOp

Copyright © 2018 www.massapicom. 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.