Class ScalingParameters
java.lang.Object
org.hippoecm.frontend.plugins.gallery.imageutil.ScalingParameters
- All Implemented Interfaces:
Serializable
Parameters for a scaling operation: the width and height of the bounding box, and whether to do
upscaling or not.
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionScalingParameters
(int width, int height, boolean upscaling) Deprecated.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.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
Modifier and TypeMethodDescriptionboolean
float
int
boolean
Deprecated.UseisUpscaling()
insteadint
getWidth()
int
hashCode()
boolean
boolean
toString()
-
Constructor Details
-
ScalingParameters
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 Details
-
getWidth
public int getWidth()- Returns:
- the width of the bounding box
-
getHeight
public int getHeight()- Returns:
- the height of the bounding box
-
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
- Returns:
- the scaling strategy to use
-
isCropping
public boolean isCropping()- Returns:
- whether cropping should be used to fill the bounding box
-
equals
-
getCompressionQuality
public float getCompressionQuality() -
hashCode
public int hashCode() -
toString
-
ScalingParameters.Builder
instead