Class CropOption
- java.lang.Object
-
- org.silverpeas.core.io.media.image.option.AbstractImageToolOption
-
- org.silverpeas.core.io.media.image.option.CropOption
-
public class CropOption extends AbstractImageToolOption
- Author:
- silveryocha
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CropOption
crop(int width, int height)
Creates a new option of cropping from the specified width and height in pixels.Integer
getHeight()
Integer
getOffsetX()
Integer
getOffsetY()
Integer
getWidth()
CropOption
keepPartsAroundCroppedZone()
By default, on a crop operation the parts of image around the cropped zone is removed.boolean
mustRemovePartsAroundCroppedZone()
CropOption
withOffset(int offsetX, int offsetY)
Indicating the offset from which the crop MUST be performed.-
Methods inherited from class org.silverpeas.core.io.media.image.option.AbstractImageToolOption
equals, hashCode
-
-
-
-
Method Detail
-
crop
public static CropOption crop(int width, int height)
Creates a new option of cropping from the specified width and height in pixels.- Parameters:
width
- the width of crop in pixels.height
- the height of crop in pixels.- Returns:
- an instance of
CropOption
type.
-
withOffset
public CropOption withOffset(int offsetX, int offsetY)
Indicating the offset from which the crop MUST be performed. The offset is computed from top left of the image.By default, offset is [0,0] coordinate.
- Parameters:
offsetX
- an integer on the horizontal axis.offsetY
- an integer on the vertical axis.- Returns:
- the
CropOption
instance.
-
keepPartsAroundCroppedZone
public CropOption keepPartsAroundCroppedZone()
By default, on a crop operation the parts of image around the cropped zone is removed. In the case these parts are needed, just call this method.- Returns:
- the
CropOption
instance.
-
getWidth
public Integer getWidth()
-
getHeight
public Integer getHeight()
-
getOffsetX
public Integer getOffsetX()
-
getOffsetY
public Integer getOffsetY()
-
mustRemovePartsAroundCroppedZone
public boolean mustRemovePartsAroundCroppedZone()
-
-