Package eu.europa.esig.dss.pdf.visible
Class ImageRotationUtils
java.lang.Object
eu.europa.esig.dss.pdf.visible.ImageRotationUtils
Contains utils for the image rotation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault 0 degreesstatic final int180 degreesstatic final int270 degreesstatic final int360 degrees (= 0 degrees)static final int90 degreesstatic final StringA message with supported angles -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetRotation(VisualSignatureRotation visualSignatureRotation) Returns rotation parameter not depending on the page rotationstatic intgetRotation(VisualSignatureRotation visualSignatureRotation, int pageRotation) Returns rotation based on the page's default rotation parameterstatic booleanisSwapOfDimensionsRequired(int rotation) Verifies if swap of dimensions is required with the current rotationstatic booleanVerifies if swap of dimensions is required with the current rotationstatic AnnotationBoxrotateRelativelyWrappingBox(AnnotationBox annotationBox, AnnotationBox wrappingBox, int rotation) This method rotates the givenannotationBoxrelatively thewrappingBoxaccording to the givenrotationstatic AnnotationBoxswapDimensions(AnnotationBox annotationBox) This method swaps dimensions of the givenAnnotationBox
-
Field Details
-
SUPPORTED_ANGLES_ERROR_MESSAGE
A message with supported angles- See Also:
-
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-VisualSignatureRotationpageRotation- 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-introtation 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 givenannotationBoxrelatively thewrappingBoxaccording to the givenrotation- Parameters:
annotationBox-AnnotationBoxto rotatewrappingBox-AnnotationBoxrepresenting wrapping boxrotation- rotation degree- Returns:
AnnotationBox
-