Package java.awt.image

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


            // 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


            kernel[i] = 1f / n;
        }

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

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

        bufferedImage = null;
        graphics = null;
View Full Code Here

        if( ! m_Enabled )
            return image;
           
        Kernel kernel = new Kernel( m_ConvolveWidth, m_ConvolveHeight, m_Data );
        ConvolveOp op = new ConvolveOp( kernel, ConvolveOp.EDGE_NO_OP, null );
        WritableRaster r = op.filter( image, null );
        return r;
    }

    private float[] getFloatArray( String values )
    {
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

        BufferedImage nextSource = src;

        for (int i = 0; i < numOfPasses; i++) {
            tempImage = gaussianOp1.filter(nextSource, tempImage);
            dst = gaussianOp2.filter(tempImage, dst);

            nextSource = dst;
        }

        if (needToConvert) {
View Full Code Here

        bg.fill(blurShape);
        bg.dispose();

        // Blur shape
        ConvolveOp blur = new ConvolveOp(new GaussianKernel(DisplayConstants.HALO_BLUR_SIZE));
        haloImage = blur.filter(haloImage, null);

        return haloImage;
    }

    /**
 
View Full Code Here

                float[] kernel = new float[aperture * aperture];
                java.util.Arrays.fill(kernel, 1.0f / (float) aperture / (float) aperture);
                BufferedImage image = ImageIO.read(inputFile);
                // simple processing: blur
                BufferedImageOp op = new ConvolveOp(new Kernel(aperture, aperture, kernel));
                BufferedImage result = op.filter(image, null);
                ImageIO.write(result, outputFormat, outputFile);
            } else
                throw new IllegalArgumentException("Unknown command " + args[0]);
        }
    }
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

            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

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.