Package io.github.humbleui.skija
Enum EncodedOrigin
- java.lang.Object
-
- java.lang.Enum<EncodedOrigin>
-
- io.github.humbleui.skija.EncodedOrigin
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<EncodedOrigin>
public enum EncodedOrigin extends java.lang.Enum<EncodedOrigin>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description _UNUSEDBOTTOM_LEFTReflected across x-axisBOTTOM_RIGHTRotated 180LEFT_BOTTOMRotated 90 CCWLEFT_TOPReflected across x-axis, Rotated 90 CCWRIGHT_BOTTOMReflected across x-axis, Rotated 90 CWRIGHT_TOPRotated 90 CWTOP_LEFTDefaultTOP_RIGHTReflected across y-axis
-
Field Summary
Fields Modifier and Type Field Description static EncodedOrigin[]_values
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanswapsWidthHeight()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.Matrix33toMatrix(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 EncodedOriginvalueOf(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.
-
-
-
Enum Constant Detail
-
_UNUSED
@Internal public static final EncodedOrigin _UNUSED
-
TOP_LEFT
public static final EncodedOrigin TOP_LEFT
Default
-
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
-
_values
@Internal public static final EncodedOrigin[] _values
-
-
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 namejava.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.
-
-