Class CropImageAction.Cropping
java.lang.Object
org.ametys.plugins.core.upload.image.CropImageAction.Cropping
- Enclosing class:
- CropImageAction
Represents a rectangular cropping of an image.
It stores only relative float values (which are between 0 and 1) as ratio of the width and height of the original image, which are unknown.
It stores only relative float values (which are between 0 and 1) as ratio of the width and height of the original image, which are unknown.
-
Constructor Summary
ModifierConstructorDescriptionprotected
Cropping
(Parameters parameters) Builds a new Cropping object fromParameters
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
getHeight
(int originalHeight) Gets the height of the cropping rectangular regionprotected int
getWidth
(int originalWidth) Gets the width of the cropping rectangular regionprotected int
getX
(int originalWidth) Gets the X coordinate of the upper-left corner of the cropping rectangular regionprotected int
getY
(int originalHeight) Gets the Y coordinate of the upper-left corner of the cropping rectangular regionprotected boolean
Returnstrue
if this cropping actually represents the original image
-
Constructor Details
-
Cropping
Builds a new Cropping object fromParameters
- Parameters:
parameters
- The parameters
-
-
Method Details
-
isOriginal
Returnstrue
if this cropping actually represents the original image- Returns:
true
if this cropping actually represents the original image
-
getX
Gets the X coordinate of the upper-left corner of the cropping rectangular region- Parameters:
originalWidth
- The width of the original image- Returns:
- the X coordinate of the upper-left corner of the cropping rectangular region
-
getY
Gets the Y coordinate of the upper-left corner of the cropping rectangular region- Parameters:
originalHeight
- The height of the original image- Returns:
- the Y coordinate of the upper-left corner of the cropping rectangular region
-
getWidth
Gets the width of the cropping rectangular region- Parameters:
originalWidth
- The width of the original image- Returns:
- the width of the cropping rectangular region
-
getHeight
Gets the height of the cropping rectangular region- Parameters:
originalHeight
- The height of the original image- Returns:
- the height of the cropping rectangular region
-