public class ConstantScaleFactor extends ScaleCalculator
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.
Constructor and Description |
---|
ConstantScaleFactor() |
ConstantScaleFactor(double value) |
Modifier and Type | Method and Description |
---|---|
ScaleFactor |
calculate(Optional<Dimensions> dimensionsToBeScaled,
Optional<ImageSizeSuggestion> suggestedSize)
Calculates a scaling-factor for a source image/entity of particular dimensions.
|
double |
getValue()
The constant floating-point value to scale each dimension by.
|
void |
setValue(double value)
The constant floating-point value to scale each dimension by.
|
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public ConstantScaleFactor()
public ConstantScaleFactor(double value)
public ScaleFactor calculate(Optional<Dimensions> dimensionsToBeScaled, Optional<ImageSizeSuggestion> suggestedSize) throws OperationFailedException
ScaleCalculator
calculate
in class ScaleCalculator
dimensionsToBeScaled
- dimensions of the source image/entity that will be scaled, if
they are known.suggestedSize
- a string suggesting dimensions to resize to or a scaling-factor.OperationFailedException
- if a scale-factor cannot be successfully calculated.public double getValue()
public void setValue(double value)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.