Package eu.europa.esig.dss.pdf.visible
Class ImageRotationUtils
java.lang.Object
eu.europa.esig.dss.pdf.visible.ImageRotationUtils
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default 0 degreesstatic final int
180 degreesstatic final int
270 degreesstatic final int
360 degrees (= 0 degrees)static final int
90 degreesstatic final String
A message with supported angles -
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationBox
ensureNoRotate
(AnnotationBox annotationBox, int pageRotation) This method is used to ensure the annotation wrapping box defines correct coordinates relatively the "noRotate" flagstatic int
getRotation
(VisualSignatureRotation visualSignatureRotation) Returns rotation parameter not depending on the page rotationstatic int
getRotation
(VisualSignatureRotation visualSignatureRotation, int pageRotation) Returns rotation based on the page's default rotation parameterstatic boolean
isSwapOfDimensionsRequired
(int rotation) Verifies if swap of dimensions is required with the current rotationstatic boolean
Verifies if swap of dimensions is required with the current rotationstatic AnnotationBox
rotateRelativelyWrappingBox
(AnnotationBox annotationBox, AnnotationBox wrappingBox, int rotation) This method rotates the givenannotationBox
relatively thewrappingBox
according to the givenrotation
static AnnotationBox
swapDimensions
(AnnotationBox annotationBox) This method swaps dimensions of the givenAnnotationBox
-
Field Details
-
SUPPORTED_ANGLES_ERROR_MESSAGE
-
ANGLE_0
public static final int ANGLE_0Default 0 degrees- See Also:
-
ANGLE_90
public static final int ANGLE_9090 degrees- See Also:
-
ANGLE_180
public static final int ANGLE_180180 degrees- See Also:
-
ANGLE_270
public static final int ANGLE_270270 degrees- See Also:
-
ANGLE_360
public static final int ANGLE_360360 degrees (= 0 degrees)- See Also:
-
-
Method Details
-
getRotation
Returns rotation parameter not depending on the page rotation- Parameters:
visualSignatureRotation
-VisualSignatureRotation
- Returns:
- int rotation angle
-
getRotation
Returns rotation based on the page's default rotation parameter- Parameters:
visualSignatureRotation
-VisualSignatureRotation
pageRotation
- the rotation of a page- Returns:
- int rotation angle
-
isSwapOfDimensionsRequired
public static boolean isSwapOfDimensionsRequired(int rotation) Verifies if swap of dimensions is required with the current rotation- Parameters:
rotation
-int
rotation degree- Returns:
- TRUE is swap of dimensions is required, FALSE otherwise
-
isSwapOfDimensionsRequired
Verifies if swap of dimensions is required with the current rotation- Parameters:
rotation
-VisualSignatureRotation
- Returns:
- TRUE is swap of dimensions is required, FALSE otherwise
-
swapDimensions
This method swaps dimensions of the givenAnnotationBox
- Parameters:
annotationBox
-AnnotationBox
- Returns:
AnnotationBox
-
rotateRelativelyWrappingBox
public static AnnotationBox rotateRelativelyWrappingBox(AnnotationBox annotationBox, AnnotationBox wrappingBox, int rotation) This method rotates the givenannotationBox
relatively thewrappingBox
according to the givenrotation
- Parameters:
annotationBox
-AnnotationBox
to rotatewrappingBox
-AnnotationBox
representing wrapping boxrotation
- rotation degree- Returns:
AnnotationBox
-
ensureNoRotate
This method is used to ensure the annotation wrapping box defines correct coordinates relatively the "noRotate" flag- Parameters:
annotationBox
-AnnotationBox
containing coordinates extracted from PDF documentpageRotation
- the page rotation degree- Returns:
AnnotationBox
with coordinates for the "noRotate" flag annotation relatively the page's rotation
-