Class HorizontalRotation

  • All Implemented Interfaces:
    Rotation

    public class HorizontalRotation
    extends java.lang.Object
    implements Rotation
    Horizontally rotates each row i.e. perform side rotation on each row & obtains new buffered image

    A row, [2, 3, 4, 5] to be rotated to [5, 4, 3, 2]

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.image.BufferedImage rotate​(java.awt.image.BufferedImage img)
      Goes over each row of buffered image & rotates it left to right, where each row rotation to be done by one thread i.e.
      java.awt.image.BufferedImage rotate​(java.lang.String src)
      Reads content of image & calls method defined exactly above
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HorizontalRotation

        public HorizontalRotation()
    • Method Detail

      • rotate

        public java.awt.image.BufferedImage rotate​(java.awt.image.BufferedImage img)
        Goes over each row of buffered image & rotates it left to right, where each row rotation to be done by one thread i.e. concurrently rows can be rotated by different threads

        Reversing each row is what we call horizontally rotating image i.e. rotating image across its X-axis 180°

        Specified by:
        rotate in interface Rotation
      • rotate

        public java.awt.image.BufferedImage rotate​(java.lang.String src)
        Reads content of image & calls method defined exactly above
        Specified by:
        rotate in interface Rotation