Package java.awt.image

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


            kernel[i] = 1f / n;
        }

        ConvolveOp blur = new ConvolveOp(new Kernel(blurMagnitude, blurMagnitude,
            kernel), ConvolveOp.EDGE_NO_OP, null);
        bufferedImage = blur.filter(bufferedImage, null);

        this.graphics.drawImage(bufferedImage, 0, 0, null);
    }

    public Bounds getBounds(Component component) {
View Full Code Here


            BufferedImage srcBI;
            srcBI = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), null);

            // Easy case just apply the op...
            destBI = op.filter(srcBI, null);

        } else {
            BufferedImage srcBI;
            srcBI = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), null);
View Full Code Here

            // Create the BufferedImage.
            BufferedImage tmpDstBI = new BufferedImage
                (cm, dstWR, cm.isAlphaPremultiplied(), null);

            // Filter between the two image without alpha.
            tmpDstBI = op.filter(tmpSrcBI, tmpDstBI);

            // org.apache.batik.test.gvt.ImageDisplay.showImage
            //   ("tmpDstBI: ", tmpDstBI);

            // Copy the alpha channel into the result (note the color
View Full Code Here

              0.111f, 0.111f, 0.111f,
              0.111f, 0.111f, 0.111f,
          };

        BufferedImageOp op = new ConvolveOp( new Kernel(3, 3, matrix) );
        img = op.filter(img, new BufferedImage(320, 240, BufferedImage.TYPE_INT_ARGB));
        return img;
  }
 
  public int[] convertToBW(int[] greypxls) {
    int[] bwpxls = new int[greypxls.length];
View Full Code Here

                      0.111f, 0.111f, 0.111f,
                      0.111f, 0.111f, 0.111f,
                  };

                BufferedImageOp op = new ConvolveOp( new Kernel(3, 3, matrix) );
                img = op.filter(img, new BufferedImage(320, 240, BufferedImage.TYPE_INT_ARGB));
               
                int[] argb = img.getRGB(0, 0, 320, 240, null, 0, 320);
                if (mode.equals("calibrate")) {
                  String[] results = oculusImage.findBlobStart(x,y,img.getWidth(), img.getHeight(), argb);
                  autoDock("dockgrabbed calibrate "+results[0]+" "+results[1]+" "+results[2]+" "+results[3]+" "+results[4]+" "+
View Full Code Here

            kernel = new Kernel(3, 3, new float[] { -0.25f, -0.5f, -0.25f, -0.5f, 4, -0.5f, -0.25f, -0.5f, -0.25f});
        } else {
            kernel = new Kernel(3, 3, new float[] { -0.5f, -1, -0.5f, -1, 7, -1, -0.5f, -1, -0.5f});
        }
        BufferedImageOp op = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);
        return op.filter(tmp, null);
    }

    public void drawErrorTile(BufferedImage img) {
        Graphics g = img.getGraphics();
        g.setColor(Color.RED);
View Full Code Here

        g.dispose();

        final float[] softenArray = {0, SOFTEN_FACTOR, 0, SOFTEN_FACTOR, 1 - (SOFTEN_FACTOR * 4), SOFTEN_FACTOR, 0, SOFTEN_FACTOR, 0};
        final Kernel kernel = new Kernel(3, 3, softenArray);
        final ConvolveOp cOp = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null);
        final BufferedImage filteredBufferedImage = cOp.filter(bufferedImage, null);

        final Iterator it = ImageIO.getImageWritersByFormatName(FORMAT_NAME);
        final ImageWriter writer = (ImageWriter) it.next();
        final ImageWriteParam iwp = writer.getDefaultWriteParam();
        iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
View Full Code Here

            kernel[i] = 1f / n;
        }

        ConvolveOp blur = new ConvolveOp(new Kernel(blurMagnitude, blurMagnitude,
            kernel), ConvolveOp.EDGE_NO_OP, null);
        bufferedImage = blur.filter(bufferedImage, null);

        this.graphics.drawImage(bufferedImage, 0, 0, null);
    }

    @Override
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

    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);
    }
  }

  /**
   * Get the colour of the shadow generated
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.