Enum EncodedOrigin

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<EncodedOrigin>

    public enum EncodedOrigin
    extends java.lang.Enum<EncodedOrigin>
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean swapsWidthHeight()
      Return true if the encoded origin includes a 90 degree rotation, in which case the width and height of the source data are swapped relative to a correctly oriented destination.
      Matrix33 toMatrix​(int w, int h)
      Given an encoded origin and the width and height of the source data, returns a matrix that transforms the source rectangle with upper left corner at [0, 0] and origin to a correctly oriented destination rectangle of [0, 0, w, h].
      static EncodedOrigin valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static EncodedOrigin[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • TOP_RIGHT

        public static final EncodedOrigin TOP_RIGHT
        Reflected across y-axis
      • BOTTOM_RIGHT

        public static final EncodedOrigin BOTTOM_RIGHT
        Rotated 180
      • BOTTOM_LEFT

        public static final EncodedOrigin BOTTOM_LEFT
        Reflected across x-axis
      • LEFT_TOP

        public static final EncodedOrigin LEFT_TOP
        Reflected across x-axis, Rotated 90 CCW
      • RIGHT_TOP

        public static final EncodedOrigin RIGHT_TOP
        Rotated 90 CW
      • RIGHT_BOTTOM

        public static final EncodedOrigin RIGHT_BOTTOM
        Reflected across x-axis, Rotated 90 CW
      • LEFT_BOTTOM

        public static final EncodedOrigin LEFT_BOTTOM
        Rotated 90 CCW
    • Field Detail

    • Method Detail

      • values

        public static EncodedOrigin[] 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 (EncodedOrigin c : EncodedOrigin.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EncodedOrigin valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toMatrix

        public Matrix33 toMatrix​(int w,
                                 int h)
        Given an encoded origin and the width and height of the source data, returns a matrix that transforms the source rectangle with upper left corner at [0, 0] and origin to a correctly oriented destination rectangle of [0, 0, w, h].
      • swapsWidthHeight

        public boolean swapsWidthHeight()
        Return true if the encoded origin includes a 90 degree rotation, in which case the width and height of the source data are swapped relative to a correctly oriented destination.