Package java.awt.image

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


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

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

            if (kernelHasNegValues) {
                // When the kernel has negative values it's possible
                // for the resultant image to have alpha values less
                // than the associated color values this will lead to
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

        // to gray scale
        BufferedImage grayscale = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_RGB);
        BufferedImageOp grayscaleConv =
                new ColorConvertOp(image.getColorModel().getColorSpace(),
                        grayscale.getColorModel().getColorSpace(), null);
        grayscaleConv.filter(image, grayscale);

        // blow it up for ocr
        BufferedImage newImage = new BufferedImage(bigWidth, bigHeight, BufferedImage.TYPE_INT_RGB);
        Graphics g = newImage.createGraphics();
        g.drawImage(grayscale, 0, 0, bigWidth, bigHeight, null);
View Full Code Here

      BufferedImage dest = createOptimalImage(src,
          (int) Math.round(resultBounds.getWidth()),
          (int) Math.round(resultBounds.getHeight()));

      // Perform the operation, update our result to return.
      BufferedImage result = op.filter(src, dest);

      /*
       * Flush the 'src' image ONLY IF it is one of our interim temporary
       * images being used when applying 2 or more operations back to
       * back. We never want to flush the original image passed in.
View Full Code Here

        BufferedImageOp op2 = new OldFilter();
        BufferedImageOp op3 = new OilPaintFilter(3);
       
        BufferedImageOp op = new CompoundFilter(op1, op2);
       
        dest = op.filter(src, null);

        File outputfile = new File(directory.getCanonicalPath()+"\\Compound\\"+"Compound_"+s);

        ImageIO.write(dest, "jpg", outputfile);
       
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

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.