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 aScaleFactor
that accepts floating-point values.scale
(int x, int y) Multiplies a point by the respective scaling-factor in each dimension.Multiplies anExtent
by the respective scaling-factor in each dimension.Multiplies aPoint2i
by the respective scaling-factor in each dimension.
-
Constructor Details
-
ScaleFactorInt
public ScaleFactorInt(int x, int y) Creates a newScaleFactorInt
instance.- 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 aScaleFactor
that accepts floating-point values.- Returns:
- a newly created
ScaleFactor
containing 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 aPoint2i
by the respective scaling-factor in each dimension.- Parameters:
point
- the point to be scaled.- Returns:
- a newly created scaled
Point2i
.
-
scale
Multiplies anExtent
by the respective scaling-factor in each dimension.- Parameters:
extent
- the extent to be scaled.- Returns:
- a newly created scaled
Extent
.
-