Class DimensionOption
- java.lang.Object
-
- org.silverpeas.core.io.media.image.option.AbstractImageToolOption
-
- org.silverpeas.core.io.media.image.option.DimensionOption
-
public class DimensionOption extends AbstractImageToolOption
- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getHeight()
Integer
getWidth()
static DimensionOption
height(Integer height)
Creates a new option on the dimension from the specified height in pixels.static DimensionOption
width(Integer width)
Creates a new option on the dimension from the specified width in pixels.static DimensionOption
widthAndHeight(Integer width, Integer height)
Creates a new option on the dimension from the specified width and height in pixels.-
Methods inherited from class org.silverpeas.core.io.media.image.option.AbstractImageToolOption
equals, hashCode
-
-
-
-
Method Detail
-
widthAndHeight
public static DimensionOption widthAndHeight(Integer width, Integer height)
Creates a new option on the dimension from the specified width and height in pixels.- Parameters:
width
- the width in pixels. If null, the height will only be taken into account by ImageTool when resizing an image.height
- the height in pixels. If null, the width will only be taken into account by ImageTool when resizing an image.- Returns:
- an instance of
DimensionOption
type.
-
width
public static DimensionOption width(Integer width)
Creates a new option on the dimension from the specified width in pixels. The height will be computed from the width to keep the same ratio than the original image.- Parameters:
width
- the width in pixels.- Returns:
- an instance of
DimensionOption
type.
-
height
public static DimensionOption height(Integer height)
Creates a new option on the dimension from the specified height in pixels. The width will be computed from the height to keep the same ratio than the original image.- Parameters:
height
- the height in pixels.- Returns:
- an instance of
DimensionOption
type.
-
getWidth
public Integer getWidth()
- Returns:
- the width
-
getHeight
public Integer getHeight()
- Returns:
- the height
-
-