Class ConstantScaleFactor

Object
AnchorBean<ScaleCalculator>
InitializableBean<ScaleCalculator, ImageInitialization>
ImageBean<ScaleCalculator>
ScaleCalculator
ConstantScaleFactor

public class ConstantScaleFactor extends ScaleCalculator
Scale X and Y dimension by a constant floating-point number.

e.g. Applying 0.5 to an image of size (width=50, height=10) would produce a scaled image with (width=25, height=5).

The constant floating-point number is equal across both dimensions.

Author:
Owen Feehan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ConstantScaleFactor(double value)
    Creates a new ConstantScaleFactor instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    ScaleFactor
    calculate(Optional<Dimensions> dimensionsToBeScaled, Optional<ImageSizeSuggestion> suggestedSize)
     
    double
    The constant floating-point value to scale each dimension by.
    void
    setValue(double value)
    The constant floating-point value to scale each dimension by.

    Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean

    getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ConstantScaleFactor

      public ConstantScaleFactor()
    • ConstantScaleFactor

      public ConstantScaleFactor(double value)
      Creates a new ConstantScaleFactor instance.
      Parameters:
      value - The constant floating-point value to scale each dimension by.
  • Method Details

    • calculate

      public ScaleFactor calculate(Optional<Dimensions> dimensionsToBeScaled, Optional<ImageSizeSuggestion> suggestedSize) throws OperationFailedException
      Specified by:
      calculate in class ScaleCalculator
      Throws:
      OperationFailedException
    • getValue

      public double getValue()
      The constant floating-point value to scale each dimension by.
    • setValue

      public void setValue(double value)
      The constant floating-point value to scale each dimension by.