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:
Cloneable,DrawOperation
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEnumerated class for proportions attribute. -
Field Summary
Fields inherited from class org.apache.tools.ant.types.optional.imageio.ImageOperation
instructionsFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAbstract method which is intended to create an image buffer and return it so it can be drawn into another object.Performs the transformations.floatGet the height.floatgetWidth()Get the width.performScale(BufferedImage image) Scale an image.voidSets the height of the image, either as an integer or a %.voidSets the behaviour regarding the image proportions.voidSets 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, addScaleMethods 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, toStringMethods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
Scale
public Scale()
-
-
Method Details
-
setProportions
Sets the behaviour regarding the image proportions.- Parameters:
pa- the enumerated value.
-
setWidth
Sets the width of the image, either as an integer or a %. Defaults to 100%.- Parameters:
width- the value to use.
-
setHeight
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
Scale an image.- Parameters:
image- the image to scale.- Returns:
- the scaled image.
-
executeTransformOperation
Performs the transformations..- Specified by:
executeTransformOperationin classTransformOperation- Parameters:
image- The image to perform the transformation on.- Returns:
- the transformed image.
-
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:
executeDrawOperationin interfaceDrawOperation- Returns:
- a planar image
-