Package org.imgscalr

Enum Scalr.Rotation

  • All Implemented Interfaces:
    Serializable, Comparable<Scalr.Rotation>
    Enclosing class:
    Scalr

    public static enum Scalr.Rotation
    extends Enum<Scalr.Rotation>
    Used to define the different types of rotations that can be applied to an image during a resize operation.
    Since:
    3.2
    Author:
    Riyad Kalla (software@thebuzzmedia.com)
    • Enum Constant Detail

      • CW_90

        public static final Scalr.Rotation CW_90
        90-degree, clockwise rotation (to the right). This is equivalent to a quarter-turn of the image to the right; moving the picture on to its right side.
      • CW_180

        public static final Scalr.Rotation CW_180
        180-degree, clockwise rotation (to the right). This is equivalent to 1 half-turn of the image to the right; rotating the picture around until it is upside down from the original position.
      • CW_270

        public static final Scalr.Rotation CW_270
        270-degree, clockwise rotation (to the right). This is equivalent to a quarter-turn of the image to the left; moving the picture on to its left side.
      • FLIP_HORZ

        public static final Scalr.Rotation FLIP_HORZ
        Flip the image horizontally by reflecting it around the y axis.

        This is not a standard rotation around a center point, but instead creates the mirrored reflection of the image horizontally.

        More specifically, the vertical orientation of the image stays the same (the top stays on top, and the bottom on bottom), but the right and left sides flip. This is different than a standard rotation where the top and bottom would also have been flipped.

      • FLIP_VERT

        public static final Scalr.Rotation FLIP_VERT
        Flip the image vertically by reflecting it around the x axis.

        This is not a standard rotation around a center point, but instead creates the mirrored reflection of the image vertically.

        More specifically, the horizontal orientation of the image stays the same (the left stays on the left and the right stays on the right), but the top and bottom sides flip. This is different than a standard rotation where the left and right would also have been flipped.

    • Method Detail

      • values

        public static Scalr.Rotation[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Scalr.Rotation c : Scalr.Rotation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Scalr.Rotation valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null