Class RotationSupport

java.lang.Object
se.datadosen.util.RotationSupport
Direct Known Subclasses:
GenericRotationSupport

public class RotationSupport
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int LEFT_ROTATED  
    static int LEFT_ROTATED_FLIPPED  
    static int NOT_ROTATED  
    static int NOT_ROTATED_FLIPPED  
    static int RIGHT_ROTATED  
    static int RIGHT_ROTATED_FLIPPED  
    static int UPSIDE_DOWN  
    static int UPSIDE_DOWN_FLIPPED  
  • Constructor Summary

    Constructors 
    Constructor Description
    RotationSupport()  
  • Method Summary

    Modifier and Type Method Description
    static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, int existingOrientation)  
    static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, com.drew.metadata.Metadata meta)  
    static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, java.io.File file)  
    static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, java.lang.String existingOrientation)  
    static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, Orientation existingOrientation)  
    static javax.swing.ImageIcon adjustOrientation​(javax.swing.ImageIcon ii, com.drew.metadata.Metadata meta)  
    static javax.swing.ImageIcon adjustOrientation​(javax.swing.ImageIcon ii, java.io.File file)  
    protected static java.lang.String asString​(int orientation)  
    protected static java.awt.image.BufferedImage createBufferedImage​(java.awt.Image img, int iw, int ih)  
    static java.awt.image.BufferedImage flip​(java.awt.image.BufferedImage bi, boolean vertically)  
    static int getOrientation​(com.drew.metadata.Metadata meta)  
    static int getOrientation​(java.io.File file)
    Get image orientation without using MetadataExtractor
    static java.lang.String getOrientationAsString​(com.drew.metadata.Metadata meta)  
    static java.lang.String getOrientationAsString​(java.io.File file)  
    static java.awt.image.BufferedImage rotate180​(java.awt.image.BufferedImage bi)  
    static java.awt.image.BufferedImage rotateLeft​(java.awt.image.BufferedImage bi)  
    static java.awt.image.BufferedImage rotateRight​(java.awt.image.BufferedImage bi)  
    static boolean setOrientation​(int orientation, java.io.File file)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • flip

      public static java.awt.image.BufferedImage flip​(java.awt.image.BufferedImage bi, boolean vertically)
    • rotate180

      public static java.awt.image.BufferedImage rotate180​(java.awt.image.BufferedImage bi)
    • rotateLeft

      public static java.awt.image.BufferedImage rotateLeft​(java.awt.image.BufferedImage bi)
    • rotateRight

      public static java.awt.image.BufferedImage rotateRight​(java.awt.image.BufferedImage bi)
    • adjustOrientation

      public static javax.swing.ImageIcon adjustOrientation​(javax.swing.ImageIcon ii, com.drew.metadata.Metadata meta)
    • adjustOrientation

      public static javax.swing.ImageIcon adjustOrientation​(javax.swing.ImageIcon ii, java.io.File file)
    • createBufferedImage

      protected static java.awt.image.BufferedImage createBufferedImage​(java.awt.Image img, int iw, int ih)
    • adjustOrientation

      public static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, com.drew.metadata.Metadata meta)
    • adjustOrientation

      public static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, java.io.File file)
    • getOrientation

      public static int getOrientation​(com.drew.metadata.Metadata meta)
    • getOrientationAsString

      public static java.lang.String getOrientationAsString​(com.drew.metadata.Metadata meta)
    • getOrientation

      public static int getOrientation​(java.io.File file) throws java.io.IOException
      Get image orientation without using MetadataExtractor
      Parameters:
      file -
      Returns:
      Throws:
      java.io.IOException
    • getOrientationAsString

      public static java.lang.String getOrientationAsString​(java.io.File file)
    • setOrientation

      public static boolean setOrientation​(int orientation, java.io.File file) throws java.io.IOException
      Throws:
      java.io.IOException
    • asString

      protected static java.lang.String asString​(int orientation)
    • adjustOrientation

      public static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, Orientation existingOrientation)
    • adjustOrientation

      public static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, java.lang.String existingOrientation)
    • adjustOrientation

      public static java.awt.image.BufferedImage adjustOrientation​(java.awt.image.BufferedImage bi, int existingOrientation)