Package java.awt.image

Examples of java.awt.image.RescaleOp


     *            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

        scaleColor[1] = params.getParameterAsFloat( prefix + "scale-green", -1.0f);
        scaleColor[2] = params.getParameterAsFloat( prefix + "scale-blue", -1.0f);
        offsetColor[0] = params.getParameterAsFloat( prefix + "offset-red", 0.0f);
        offsetColor[1] = params.getParameterAsFloat( prefix + "offset-green", 0.0f);
        offsetColor[2] = params.getParameterAsFloat( prefix + "offset-blue", 0.0f);
        colorFilter = new RescaleOp( scaleColor, offsetColor, null );
    }
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

  private void initEffects()
  // Create pre-defined image operations for image negation and blurring.
  {
    // image negative.  Multiply each colour value by -1.0 and add 255
    negOp = new RescaleOp(-1.0f, 255f, null);

    // image negative for images with transparency
    float[] negFactors = {-1.0f, -1.0f, -1.0f, 1.0f}// don't change the alpha
    float[] offsets = {255f, 255f, 255f, 0.0f};
    negOpTrans = new RescaleOp(negFactors, offsets, null);


    // blur by convolving the image with a matrix
    float ninth = 1.0f / 9.0f;
View Full Code Here

      logger.debug("Brightness must be >= 0.0f; setting to 0.5f");
      brightness = 0.5f;
    }
    // brightness may be less than 1.0 to make the image dimmer

    RescaleOp brigherOp;
    if (hasAlpha(im)) {
       float[] scaleFactors = {brightness, brightness, brightness, 1.0f};
                // don't change alpha
                // without the 1.0f the RescaleOp fails, which is a bug (?)
       float[] offsets = {0.0f, 0.0f, 0.0f, 0.0f};
       brigherOp = new RescaleOp(scaleFactors, offsets, null);
    }
    else   // not transparent
      brigherOp = new RescaleOp(brightness, 0, null);

    g2d.drawImage(im, brigherOp, x, y);
  // end of drawBrighterImage()
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.