Package java.awt.image

Examples of java.awt.image.FilteredImageSource


    Image       baseImage,
    ImageFilter imageFilter
    )
  {
    // get the filtered image producer
    ImageProducer producer = new FilteredImageSource(baseImage.getSource(),
                                                     imageFilter);

    // return the filtered image
    return Toolkit.getDefaultToolkit().createImage(producer);
  }
View Full Code Here


   * Implementation of ImageEncoder.encodeImage()
   */
  public void encodeImage(Image image, OutputStream out)
    throws IOException
  {
    Image alphaFilteredImage = Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(image.getSource(),
                                                                                               new AlphaMultiplyFilter(_WHITE)));
    Image filteredImage = Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(alphaFilteredImage.getSource(),
                                                                                          new OctreeFilter(alphaFilteredImage)));
    _wrappedEncoder.encodeImage(filteredImage, out);
   
  }
View Full Code Here

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    ImageProducer producer = icon.getSource();

    // If direction is RTL, flip the source image
    if (_isRightToLeft(context))
      producer = new FilteredImageSource(producer, new MirrorImageFilter());

    Image colorizedIcon =
      toolkit.createImage(new FilteredImageSource(producer, filter));

    // Be sure that the image is fully loaded
    ImageUtils.loadImage(colorizedIcon);

    // Get the width/height.  We use an ImageLoader object the ImageObserver
View Full Code Here

    ImageProducer producer = icon.getSource();

    // If direction is RTL, flip the source image
    if (_isRightToLeft(context))
      producer = new FilteredImageSource(producer, new MirrorImageFilter());

    Image flippedIcon =
      toolkit.createImage(producer);

    // Be sure that the image is fully loaded
View Full Code Here

        final Image imageArea;
        if (img.getWidth(observer) == widthImage && img.getHeight(observer) == heightImage) {
            imageArea = img;
        } else {
            // Extract the image with a CropImageFilter
            imageArea = new ToolkitImage(new FilteredImageSource(img.getSource(),
                new CropImageFilter(xImage, yImage, widthImage, heightImage)));
        }

        if (widthImage == widthDest && heightImage == heightDest) {
            if (bgcolor == null) {
View Full Code Here

            return true;

        if (img.getWidth(observer) == width && img.getHeight(observer) == height)
            return drawImage(img, x, y, bgcolor, observer);

        return drawImage(new ToolkitImage(new FilteredImageSource(img.getSource(),
            new AreaAveragingScaleFilter(width, height))), x, y, bgcolor, observer);
    }
View Full Code Here

            return true;

        if (img.getWidth(observer) == width && img.getHeight(observer) == height)
            return drawImage(img, x, y, observer);

        return drawImage(new ToolkitImage(new FilteredImageSource(img.getSource(),
            new AreaAveragingScaleFilter(width, height))), x, y, observer);
    }
View Full Code Here

     *      java.awt.Color, java.awt.image.ImageObserver)
     */
    public final boolean drawImage(Image image, int x, int y, int width, int height, Color bgcolor,
                                   ImageObserver observer) {
        return drawImage(
            new ToolkitImage(new FilteredImageSource(image.getSource(), new AreaAveragingScaleFilter(width, height))),
            x,
            y, bgcolor, observer);
    }
View Full Code Here

     * @return boolean
     * @see java.awt.Graphics#drawImage(java.awt.Image, int, int, int, int, java.awt.image.ImageObserver)
     */
    public final boolean drawImage(Image image, int x, int y, int width, int height, ImageObserver observer) {
        return drawImage(
            new ToolkitImage(new FilteredImageSource(image.getSource(), new AreaAveragingScaleFilter(width, height))),
            x,
            y, observer);
    }
View Full Code Here

            heightDest = dy1 - dy2 + 1;
            yDest = dy2;
        }

        // Extract the image with a CropImageFilter
        final Image imageArea = new ToolkitImage(new FilteredImageSource(image.getSource(),
            new CropImageFilter(xImage, yImage, widthImage, heightImage)));
        if (bgColor == null) {
            return drawImage(imageArea, xDest, yDest, widthDest, heightDest, observer);
        } else {
            return drawImage(imageArea, xDest, yDest, widthDest, heightDest, bgColor, observer);
View Full Code Here

TOP

Related Classes of java.awt.image.FilteredImageSource

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.