All Implemented Interfaces:
Cloneable, DrawOperation

public class Scale extends TransformOperation implements DrawOperation
See Also:
  • 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(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(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 javax.media.jai.PlanarImage performScale(javax.media.jai.PlanarImage image)
      Scale an image.
      Parameters:
      image - the image to scale.
      Returns:
      the scaled image.
    • executeTransformOperation

      public javax.media.jai.PlanarImage executeTransformOperation(javax.media.jai.PlanarImage 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 javax.media.jai.PlanarImage 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