Package java.awt.image

Examples of java.awt.image.RescaleOp


                filterColor = true;
            }
        }

        if (filterColor) {
            this.colorFilter = new RescaleOp(scaleColor, offsetColor, null);
        }

        usePercent = false;
        lastChar = tmpWidth.charAt(tmpWidth.length() - 1);
        if (lastChar == '%') {
View Full Code Here


                            new LookupOp(new ShortLookupTable(0, yellowInvert),
                                         null);
                    }
                }
            } else if (op.equals("rescale1band")) {
                ictx.bufImgOp = new RescaleOp(0.5f, 10.0f, null);
            } else if (op.equals("rescale3band")) {
                float[] scaleFactors = { 0.5f0.3f, 0.8f };
                float[] offsets      = { 5.0f, -7.5f, 1.0f };
                ictx.bufImgOp = new RescaleOp(scaleFactors, offsets, null);
            } else {
                throw new InternalError("Invalid image op");
            }

            ictx.rasterOp = (RasterOp)ictx.bufImgOp;
View Full Code Here

    g.setColor (bg);
    g.fillRect (0, 0, width, height);
   
    g.setColor (fg);
   
    g.drawImage (picture, new RescaleOp (1, 0, null), 5 + fm.getHeight () + 5, 5);

    g.drawImage (colorLegend, new RescaleOp (1, 0, null), 5 + fm.getHeight () + 5 + picture.getWidth () + 5, 5);
   
    // bottom legend
    g.drawString (srt, 5 + fm.getHeight () + 55 + picture.getHeight () + 5 + fm.getHeight ());
    g.drawString (rt, 5 + fm.getHeight () + 5 + picture.getWidth () / 2 - fm.stringWidth (rt) / 25 + picture.getHeight () + 5 + fm.getHeight ());
    g.drawString (ert, 5 + fm.getHeight () + 5 + picture.getWidth () - fm.stringWidth (ert)5 + picture.getHeight () + 5 + fm.getHeight ());
View Full Code Here

            float shadow[] = {0.1f,0.1f,0.1f,0.65f};
            float offset[] = {0f,0f,0f,0f};
           
            // Draw the icon upper-left "shadow" (subtle outline)
            pd.icon.paintIcon(null, bufferedImage.getGraphics(), 0, 0);          
            bufferedImage = new RescaleOp(preshadow, offset, null).filter(bufferedImage, null);
           
            // Draw the lower-right shadow
            pd.icon.paintIcon(null, bufferedImage.getGraphics(), 2, 2);
            bufferedImage =  new RescaleOp(shadow, offset, null).filter(bufferedImage, null);
        }
       
        // Repaint original icon
        pd.icon.paintIcon(null, bufferedImage.getGraphics(), 1, 1);
       
View Full Code Here

        coloration[3] = 1f; // Always full alpha

        float offset[] = {0f,0f,0f,0f};
       
        // Repaint original icon & colorize
        return new RescaleOp(coloration, offset, null).filter(b, null);      
    }
View Full Code Here

            setOpaque(true);
            repaint();   
            return;
        }
       
        RescaleOp rescaleOp = new RescaleOp(1.1f, 35, null);
       
        // Create an RGB buffered image
        BufferedImage bimage = new BufferedImage(backgroundImage.getWidth(null), backgroundImage.getHeight(null), BufferedImage.TYPE_BYTE_GRAY);

        // Copy non-RGB image to the RGB buffered image
        Graphics2D g = bimage.createGraphics();
        g.drawImage(backgroundImage, 0, 0, null);
       
        // Copy non-RGB image to the RGB buffered image
        this.backgroundImage = rescaleOp.filter(bimage, null);
        setOpaque(false);
        repaint();
    }
View Full Code Here

     *            The graphics to draw on
     */
    private void draw(final Graphics2D graphics)
    {
      final float[] offsets = new float[4];
      final RescaleOp rop = new RescaleOp(scales, offsets, null);
      if (isHighlighted)
      {
        graphics.drawImage(getAnimal().highlightedImage, rop, location.x, location.y);
      }
      else
View Full Code Here

     *            The graphics to draw on
     */
    private void draw(final Graphics2D graphics)
    {
      final float[] offsets = new float[4];
      final RescaleOp rop = new RescaleOp(scales, offsets, null);
      if (isHighlighted)
      {
        graphics.drawImage(getAnimal().highlightedImage, rop, location.x, location.y);
      }
      else
View Full Code Here

                filterColor = true;
            }
        }

        if (filterColor) {
            this.colorFilter = new RescaleOp(scaleColor, offsetColor, null);
        }

        usePercent = false;
        lastChar = tmpWidth.charAt(tmpWidth.length() - 1);
        if (lastChar == '%') {
View Full Code Here

        scaleColor[1] = params.getParameterAsFloat( m_Prefix + "scale-green", -1.0f);
        scaleColor[2] = params.getParameterAsFloat( m_Prefix + "scale-blue", -1.0f);
        offsetColor[0] = params.getParameterAsFloat( m_Prefix + "offset-red", 0.0f);
        offsetColor[1] = params.getParameterAsFloat( m_Prefix + "offset-green", 0.0f);
        offsetColor[2] = params.getParameterAsFloat( m_Prefix + "offset-blue", 0.0f);
        m_ColorFilter = new RescaleOp( scaleColor, offsetColor, null );
    }
View Full Code Here

TOP

Related Classes of java.awt.image.RescaleOp

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.