Package icyllis.arc3d.engine
Class Swizzle
java.lang.Object
icyllis.arc3d.engine.Swizzle
Represents a color component mapping. It's packed as a
short value.
Do NOT change the packing format, there are inlined code in other places.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortstatic final shortstatic final shortstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final shortstatic final shortstatic final short -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapply(short swizzle, float[] inColor, float[] outColor) Applies this swizzle to the input color and returns the swizzled color.static intcharToIndex(char c) static shortconcat(short a, short b) Concatenates two swizzles (e.g.static intgetA(short swizzle) static intgetB(short swizzle) static intgetG(short swizzle) static intgetR(short swizzle) static charindexToChar(int idx) static shortmake(char r, char g, char b, char a) Compact representation of the swizzle suitable for a key.static shortmake(int r, int g, int b, int a) static shortmake(CharSequence s) Compact representation of the swizzle suitable for a key.static StringtoString(short swizzle)
-
Field Details
-
RGBA
public static final short RGBA- See Also:
-
BGRA
public static final short BGRA- See Also:
-
RGB1
public static final short RGB1- See Also:
-
BGR1
public static final short BGR1- See Also:
-
AAAA
public static final short AAAA- See Also:
-
INVALID
public static final short INVALID- See Also:
-
COMPONENT_R
public static final int COMPONENT_R- See Also:
-
COMPONENT_G
public static final int COMPONENT_G- See Also:
-
COMPONENT_B
public static final int COMPONENT_B- See Also:
-
COMPONENT_A
public static final int COMPONENT_A- See Also:
-
COMPONENT_ZERO
public static final int COMPONENT_ZERO- See Also:
-
COMPONENT_ONE
public static final int COMPONENT_ONE- See Also:
-
-
Constructor Details
-
Swizzle
public Swizzle()
-
-
Method Details
-
charToIndex
@Contract(pure=true) public static int charToIndex(char c) -
indexToChar
@Contract(pure=true) public static char indexToChar(int idx) -
make
Compact representation of the swizzle suitable for a key. Letters must be lowercase. -
make
@Contract(pure=true) public static short make(char r, char g, char b, char a) Compact representation of the swizzle suitable for a key. Letters must be lowercase. -
make
@Contract(pure=true) public static short make(int r, int g, int b, int a) -
getR
@Contract(pure=true) public static int getR(short swizzle) -
getG
@Contract(pure=true) public static int getG(short swizzle) -
getB
@Contract(pure=true) public static int getB(short swizzle) -
getA
@Contract(pure=true) public static int getA(short swizzle) -
concat
public static short concat(short a, short b) Concatenates two swizzles (e.g. concat("111R", "AAAA") -> "RRRR"). -
apply
Applies this swizzle to the input color and returns the swizzled color. -
toString
-