Class ImageRotationUtils

java.lang.Object
eu.europa.esig.dss.pdf.visible.ImageRotationUtils

public class ImageRotationUtils extends Object
Contains utils for the image rotation
  • Field Details

  • Method Details

    • getRotation

      public static int getRotation(VisualSignatureRotation visualSignatureRotation)
      Returns rotation parameter not depending on the page rotation
      Parameters:
      visualSignatureRotation - VisualSignatureRotation
      Returns:
      int rotation angle
    • getRotation

      public static int getRotation(VisualSignatureRotation visualSignatureRotation, int pageRotation)
      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

      public static boolean isSwapOfDimensionsRequired(VisualSignatureRotation rotation)
      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

      public static AnnotationBox swapDimensions(AnnotationBox annotationBox)
      This method swaps dimensions of the given AnnotationBox
      Parameters:
      annotationBox - AnnotationBox
      Returns:
      AnnotationBox
    • rotateRelativelyWrappingBox

      public static AnnotationBox rotateRelativelyWrappingBox(AnnotationBox annotationBox, AnnotationBox wrappingBox, int rotation)
      This method rotates the given annotationBox relatively the wrappingBox according to the given rotation
      Parameters:
      annotationBox - AnnotationBox to rotate
      wrappingBox - AnnotationBox representing wrapping box
      rotation - rotation degree
      Returns:
      AnnotationBox