Scale (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.types.optional.imageio, class: Scale

Package org.apache.tools.ant.types.optional.imageio

# Class Scale

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.optional.imageio.ImageOperation
org.apache.tools.ant.types.optional.imageio.TransformOperation
org.apache.tools.ant.types.optional.imageio.Scale

All Implemented Interfaces:
  `java.lang.Cloneable`, `DrawOperation`

    public class Scale
    extends TransformOperation
    implements DrawOperation

See Also:
  `ImageIOTask`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type | Class | Description
  --- | --- | ---
  `static class` | `Scale.ProportionsAttribute` | Enumerated class for proportions attribute.

- ## Field Summary

  ### Fields inherited from class org.apache.tools.ant.types.optional.imageio.ImageOperation

  `instructions`

  ### Fields inherited from class org.apache.tools.ant.types.DataType

  `checked, ref`

  ### Fields inherited from class org.apache.tools.ant.ProjectComponent

  `description, location, project`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `Scale()` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `java.awt.image.BufferedImage` | `executeDrawOperation()` | Abstract method which is intended to create an image buffer and return it so it can be drawn into another object.
  `java.awt.image.BufferedImage` | `executeTransformOperation​(java.awt.image.BufferedImage image)` | Performs the transformations.
  `float` | `getHeight()` | Get the height.
  `float` | `getWidth()` | Get the width.
  `java.awt.image.BufferedImage` | `performScale​(java.awt.image.BufferedImage image)` | Scale an image.
  `void` | `setHeight​(java.lang.String height)` | Sets the height of the image, either as an integer or a %.
  `void` | `setProportions​(Scale.ProportionsAttribute pa)` | Sets the behaviour regarding the image proportions.
  `void` | `setWidth​(java.lang.String width)` | Sets the width of the image, either as an integer or a %.

  ### Methods inherited from class org.apache.tools.ant.types.optional.imageio.ImageOperation

  `addDraw, addRotate, addScale`

  ### Methods inherited from class org.apache.tools.ant.types.DataType

  `checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes, toString`

  ### Methods inherited from class org.apache.tools.ant.ProjectComponent

  `getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Scale

    public Scale()

- ## Method Details

  - ### setProportions

    public void setProportions​(Scale.ProportionsAttribute pa)
    Sets the behaviour regarding the image proportions.
    Parameters:
      `pa` - the enumerated value.

  - ### setWidth

    public void setWidth​(java.lang.String width)
    Sets the width of the image, either as an integer or a %. Defaults to 100%.
    Parameters:
      `width` - the value to use.

  - ### setHeight

    public void setHeight​(java.lang.String height)
    Sets the height of the image, either as an integer or a %. Defaults to 100%.
    Parameters:
      `height` - the value to use.

  - ### getWidth

    public float getWidth()
    Get the width.
    Returns:
      the value converted from the width string.

  - ### getHeight

    public float getHeight()
    Get the height.
    Returns:
      the value converted from the height string.

  - ### performScale

    public java.awt.image.BufferedImage performScale​(java.awt.image.BufferedImage image)
    Scale an image.
    Parameters:
      `image` - the image to scale.
    Returns:
      the scaled image.

  - ### executeTransformOperation

    public java.awt.image.BufferedImage executeTransformOperation​(java.awt.image.BufferedImage image)
    Performs the transformations..
    Specified by:
      `executeTransformOperation` in class `TransformOperation`
    Parameters:
      `image` - The image to perform the transformation on.
    Returns:
      the transformed image.

  - ### executeDrawOperation

    public java.awt.image.BufferedImage executeDrawOperation()
    Abstract method which is intended to create an image buffer and return it so it can be drawn into another object. Use an Alpha channel for a "transparent" background..
    Specified by:
      `executeDrawOperation` in interface `DrawOperation`
    Returns:
      a planar image