Package java.awt.image

Examples of java.awt.image.ImageFilter


                && icon.getIconWidth() > 0
                && icon.getIconHeight() > 0) {
            BufferedImage img = new BufferedImage(icon.getIconWidth(),
                    icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
            icon.paintIcon(component, img.getGraphics(), 0, 0);
            ImageFilter filter = new RGBGrayFilter();
            ImageProducer producer = new FilteredImageSource(img.getSource(), filter);
            Image resultImage = component.createImage(producer);
            return new ImageIconUIResource(resultImage);
        }
        return super.getDisabledIcon(component, icon);
View Full Code Here


     * @see        java.awt.Image#SCALE_REPLICATE
     * @see        java.awt.Image#SCALE_AREA_AVERAGING
     * @since      JDK1.1
     */
    public Image getScaledInstance(int width, int height, int hints) {
        ImageFilter filter;
        if ((hints & (SCALE_SMOOTH | SCALE_AREA_AVERAGING)) != 0) {
            filter = new AreaAveragingScaleFilter(width, height);
        } else {
            filter = new ReplicateScaleFilter(width, height);
        }
View Full Code Here

    public Rectangle applyFilterDimensions(int width, int height) {

        Rectangle base = new Rectangle(width, height);
        Iterator i = m_renderSettings.getImageFilters().iterator();
        while (i.hasNext()) {
            ImageFilter filter = (ImageFilter)i.next();
            if (filter instanceof WholeImageFilter) {
                WholeImageFilter wholeFilter = (WholeImageFilter)filter;
                base = wholeFilter.getTransformedSpace(base);
            }
        }
View Full Code Here

        threadSetNice();

        Iterator i = m_renderSettings.getImageFilters().iterator();
        while (i.hasNext()) {
            ImageFilter filter = (ImageFilter)i.next();
            image = applyFilter(image, filter);
        }

        threadSetNormal();
View Full Code Here

      return null;
    }

    // Get the colorizing filter
    int[] targetColors = _getTargetColors(requestedProperties);
    ImageFilter filter = new ColorizingFilter(_SOURCE_COLORS, targetColors);

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

    // If direction is RTL, flip the source image
View Full Code Here

    public Rectangle applyFilterDimensions(int width, int height) {

        Rectangle base = new Rectangle(width, height);
        Iterator i = m_renderSettings.getImageFilters().iterator();
        while (i.hasNext()) {
            ImageFilter filter = (ImageFilter)i.next();
            if (filter instanceof WholeImageFilter) {
                WholeImageFilter wholeFilter = (WholeImageFilter)filter;
                base = wholeFilter.getTransformedSpace(base);
            }
        }
View Full Code Here

        threadSetNice();

        Iterator i = m_renderSettings.getImageFilters().iterator();
        while (i.hasNext()) {
            ImageFilter filter = (ImageFilter)i.next();
            image = applyFilter(image, filter);
        }

        threadSetNormal();
View Full Code Here

        // Create the actual Image for output
        // Pass old image through grayscale filter, creating new image
        // This is necessary since GIFs are limited to 255 colors.
        // The easiest way to guarantee this is to convert to greyscale.
        Image oldImage = createOutputImage();
        ImageFilter filter = new GreyscaleFilter();
        Image newImage = createImage(new FilteredImageSource(oldImage.getSource(), filter));

        // Use MediaTracker to wait for new image to be created
        try {
            MediaTracker tracker = new MediaTracker(this);
View Full Code Here

          MapImage mapImage = map.render(renderParam);
          BufferedImage image = mapImage.getImage();

          for (int i = rowMin; i < rowMin + createSpread; i++) {
            for (int j = colMin; j < colMin + createSpread; j++) {
              ImageFilter cropFilter = new CropImageFilter(
                  (j - colMin) * width,
                  (i - rowMin) * height, width, height);
              Image destImage = Toolkit.getDefaultToolkit()
                  .createImage(
                      new FilteredImageSource(image
View Full Code Here

                && icon.getIconWidth() > 0
                && icon.getIconHeight() > 0) {
            BufferedImage img = new BufferedImage(icon.getIconWidth(),
                    icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
            icon.paintIcon(component, img.getGraphics(), 0, 0);
            ImageFilter filter = new RGBGrayFilter();
            ImageProducer producer = new FilteredImageSource(img.getSource(), filter);
            Image resultImage = component.createImage(producer);
            return new ImageIconUIResource(resultImage);
        }
        return super.getDisabledIcon(component, icon);
View Full Code Here

TOP

Related Classes of java.awt.image.ImageFilter

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.