Package org.anchoranalysis.spatial.scale
Class ScaleFactorInt
Object
ScaleFactorInt
Like
ScaleFactor but only allows integer scaling-factors in each dimension.- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts to aScaleFactorthat accepts floating-point values.scale(int x, int y) Multiplies a point by the respective scaling-factor in each dimension.Multiplies anExtentby the respective scaling-factor in each dimension.Multiplies aPoint2iby the respective scaling-factor in each dimension.
-
Constructor Details
-
ScaleFactorInt
public ScaleFactorInt(int x, int y) Creates a newScaleFactorIntinstance.- Parameters:
x- How much to multiply the existing x-dimension by to create a scaled x-dimension.y- How much to multiply the existing y-dimension by to create a scaled y-dimension.
-
-
Method Details
-
asScaleFactor
Converts to aScaleFactorthat accepts floating-point values.- Returns:
- a newly created
ScaleFactorcontaining identical scaling values.
-
scale
Multiplies a point by the respective scaling-factor in each dimension.- Parameters:
x- the point to be scaled in the X-dimension.y- the point to be scaled in the Y-dimension.- Returns:
- a newly created scaled
Point2i.
-
scale
Multiplies aPoint2iby the respective scaling-factor in each dimension.- Parameters:
point- the point to be scaled.- Returns:
- a newly created scaled
Point2i.
-
scale
Multiplies anExtentby the respective scaling-factor in each dimension.- Parameters:
extent- the extent to be scaled.- Returns:
- a newly created scaled
Extent.
-