Examples of ImageFilter


Examples of java.awt.image.ImageFilter

                    // use grey as an index into the colormap;
                    spectrogram.setRGB(i, maxYIndex - j, cmap.getColor(grey));
                }
            }

            ImageFilter scaleFilter =
                new ReplicateScaleFilter((int) (zoom * width), (int)(vzoom*height));
            scaledSpectrogram =
                createImage(new FilteredImageSource(spectrogram.getSource(),
                                                    scaleFilter));
            Dimension sz = getSize();
View Full Code Here

Examples of java.awt.image.ImageFilter

           
            // do the zooming
            width = (int) (zoom * width);
            height = (int)(vzoom*height);

            ImageFilter scaleFilter =
                new ReplicateScaleFilter(width, height);
            scaledSpectrogram =
                createImage(new FilteredImageSource(spectrogram.getSource(),
                                                    scaleFilter));

View Full Code Here

Examples of java.awt.image.ImageFilter

    }

    public static java.awt.Image makeGrayTransparent(byte[] imageData) {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        java.awt.Image img = toolkit.createImage(imageData);
        ImageFilter filter = new RGBImageFilter() {

                public final int filterRGB(int x, int y, int rgb)
                {
                    int r = (rgb & 0xFF0000) >> 16;
                    int g = (rgb & 0xFF00) >> 8;
View Full Code Here

Examples of java.awt.image.ImageFilter

        g.fillOval((int) ((gameControl.getTime().getTimeTraveled()/((double)(Place.OREGON.getLocation()))*width-30)) + 20, (height/2)-4, 10, 10);
        g.drawImage(spaceship, (int) ((gameControl.getTime().getTimeTraveled()/((double)(Place.OREGON.getLocation()))*width)-30) + 12, (height/2)-50, 30, 30,null);
      }
  
   private Image makeColorTransparent (BufferedImage im, final Color color) {
          ImageFilter filter = new RGBImageFilter() {
          // the color we are looking for... Alpha bits are set to opaque
          public int markerRGB = color.getRGB() | 0xFF000000;

          public final int filterRGB(int x, int y, int rgb) {
              if ( ( rgb | 0xFF000000 ) == markerRGB ) {
View Full Code Here

Examples of java.awt.image.ImageFilter

    /**
     * The actual scaling code.
     */
    private Image scale(Image img, int width, int height) {
        ImageFilter filter;
        filter = new ImprovedAveragingScaleFilter(img.getWidth(null), img
                .getHeight(null), width, height);

        ImageProducer prod;
        prod = new FilteredImageSource(img.getSource(), filter);
View Full Code Here

Examples of java.awt.image.ImageFilter

            filterImages(tracker, applet, null, numimages);
    }

    private void filterImages(MediaTracker tracker, Applet applet, Toolkit tk, int numimages) {
        imgf = new Image[numimages];
        ImageFilter filter = new HotTrackImageFilter();

        for (int i = 0; i < numimages; i++) {
            if (applet != null)
                imgf[i] = applet.createImage(new FilteredImageSource(img[i].getSource(),
                        filter));
View Full Code Here

Examples of java.awt.image.ImageFilter

    public abstract int getWidth(ImageObserver observer);

    public abstract int getHeight(ImageObserver observer);

    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

Examples of java.awt.image.ImageFilter

        return bufferedImage;
    }

    private BufferedImage makeColorTransparent(BufferedImage im, final Color color) {
        ImageFilter filter = new RGBImageFilter() {

            // the color we are looking for... Alpha bits are set to opaque
            public int markerRGB = color.getRGB() | 0xFF000000;

            @Override
View Full Code Here

Examples of java.awt.image.ImageFilter

        final int width = bi.getWidth();

        final BufferedImage imageOut = new BufferedImage(width * scale, (height * scale),
                BufferedImage.TYPE_BYTE_GRAY);

        final ImageFilter filter = new RGBImageFilter() {

            @Override
            public int filterRGB(final int x, final int y, final int rgb) {
                         
                final int rgb2 = rgb & 0xFF000000;
View Full Code Here

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