Class ScaleFactorInt

Object
ScaleFactorInt

public class ScaleFactorInt extends Object
Like ScaleFactor but only allows integer scaling-factors in each dimension.
Author:
Owen Feehan
  • Constructor Details

    • ScaleFactorInt

      public ScaleFactorInt(int x, int y)
      Creates a new ScaleFactorInt 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

      public ScaleFactor asScaleFactor()
      Converts to a ScaleFactor that accepts floating-point values.
      Returns:
      a newly created ScaleFactor containing identical scaling values.
    • scale

      public Point2i scale(int x, int y)
      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

      public Point2i scale(Point2i point)
      Multiplies a Point2i by the respective scaling-factor in each dimension.
      Parameters:
      point - the point to be scaled.
      Returns:
      a newly created scaled Point2i.
    • scale

      public Extent scale(Extent extent)
      Multiplies an Extent by the respective scaling-factor in each dimension.
      Parameters:
      extent - the extent to be scaled.
      Returns:
      a newly created scaled Extent.