Class ScalingParameters
- java.lang.Object
-
- org.hippoecm.frontend.plugins.gallery.imageutil.ScalingParameters
-
- All Implemented Interfaces:
Serializable
public class ScalingParameters extends Object implements Serializable
Parameters for a scaling operation: the width and height of the bounding box, and whether to do upscaling or not.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ScalingParameters.Builder
-
Constructor Summary
Constructors Constructor Description ScalingParameters(int width, int height, boolean upscaling)
Deprecated.UseScalingParameters.Builder
insteadScalingParameters(int width, int height, boolean upscaling, boolean cropping, ImageUtils.ScalingStrategy strategy, float compressionQuality)
Creates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling.ScalingParameters(int width, int height, boolean upscaling, ImageUtils.ScalingStrategy strategy)
Deprecated.UseScalingParameters.Builder
insteadScalingParameters(int width, int height, boolean upscaling, ImageUtils.ScalingStrategy strategy, float compressionQuality)
Deprecated.UseScalingParameters.Builder
instead
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object o)
float
getCompressionQuality()
int
getHeight()
ImageUtils.ScalingStrategy
getStrategy()
boolean
getUpscaling()
Deprecated.UseisUpscaling()
insteadint
getWidth()
int
hashCode()
boolean
isCropping()
boolean
isUpscaling()
String
toString()
-
-
-
Constructor Detail
-
ScalingParameters
@Deprecated public ScalingParameters(int width, int height, boolean upscaling)
Deprecated.UseScalingParameters.Builder
insteadCreates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling. A width or height of 0 or less means 'unspecified'.- Parameters:
width
- the width of the bounding boxheight
- the height of the bounding boxupscaling
- whether to do upscaling of images that are smaller than the bounding box
-
ScalingParameters
@Deprecated public ScalingParameters(int width, int height, boolean upscaling, ImageUtils.ScalingStrategy strategy)
Deprecated.UseScalingParameters.Builder
insteadCreates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling. A width or height of 0 or less means 'unspecified'.- Parameters:
width
- the width of the bounding boxheight
- the height of the bounding boxupscaling
- whether to do upscaling of images that are smaller than the bounding boxstrategy
- the scaling strategy to use
-
ScalingParameters
@Deprecated public ScalingParameters(int width, int height, boolean upscaling, ImageUtils.ScalingStrategy strategy, float compressionQuality)
Deprecated.UseScalingParameters.Builder
insteadCreates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling. A width or height of 0 or less means 'unspecified'.- Parameters:
width
- the width of the bounding boxheight
- the height of the bounding boxupscaling
- whether to do upscaling of images that are smaller than the bounding boxstrategy
- the scaling strategy to usecompressionQuality
- compression quality
-
ScalingParameters
public ScalingParameters(int width, int height, boolean upscaling, boolean cropping, ImageUtils.ScalingStrategy strategy, float compressionQuality)
Creates a set of scaling parameters: the width and height of the bounding box, and whether to do upscaling. A width or height of 0 or less means 'unspecified'.- Parameters:
width
- the width of the bounding boxheight
- the height of the bounding boxupscaling
- whether to do upscaling of images that are smaller than the bounding boxcropping
- whether to do cropping of images to fill the whole bounding boxstrategy
- the scaling strategy to usecompressionQuality
- compression quality
-
-
Method Detail
-
getWidth
public int getWidth()
- Returns:
- the width of the bounding box
-
getHeight
public int getHeight()
- Returns:
- the height of the bounding box
-
getUpscaling
@Deprecated public boolean getUpscaling()
Deprecated.UseisUpscaling()
instead- Returns:
- whether images that are smaller than the specified bounding box should be scaled up or not.
-
isUpscaling
public boolean isUpscaling()
- Returns:
- whether images that are smaller than the specified bounding box should be scaled up or not.
-
getStrategy
public ImageUtils.ScalingStrategy getStrategy()
- Returns:
- the scaling strategy to use
-
isCropping
public boolean isCropping()
- Returns:
- whether cropping should be used to fill the bounding box
-
getCompressionQuality
public float getCompressionQuality()
-
-