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
Modifier and TypeFieldDescriptionstatic final short
static final short
static final short
static final int
static final int
static final int
static final int
static final int
static final int
static final short
static final short
static final short
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
apply
(short swizzle, float[] inColor, float[] outColor) Applies this swizzle to the input color and returns the swizzled color.static int
charToIndex
(char c) static short
concat
(short a, short b) Concatenates two swizzles (e.g.static int
getA
(short swizzle) static int
getB
(short swizzle) static int
getG
(short swizzle) static int
getR
(short swizzle) static char
indexToChar
(int idx) static short
make
(char r, char g, char b, char a) Compact representation of the swizzle suitable for a key.static short
make
(int r, int g, int b, int a) static short
make
(CharSequence s) Compact representation of the swizzle suitable for a key.static String
toString
(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
-