APIdia Launch Partner
Top Constructors Methods
com.badlogic.gdx.utils

public final Class NumberUtils

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static long
doubleToLongBits(double value)

public static int
floatToIntBits(float value)

public static int
floatToIntColor(float value)

Converts the color from a float ABGR encoding to an int ABGR encoding.

public static int
floatToRawIntBits(float value)

public static float
intBitsToFloat(int value)

public static float
intToFloatColor(int value)

Encodes the ABGR int color as a float.

public static double
longBitsToDouble(long value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NumberUtilsback to summary
public NumberUtils()

Method Detail

doubleToLongBitsback to summary
public static long doubleToLongBits(double value)
floatToIntBitsback to summary
public static int floatToIntBits(float value)
floatToIntColorback to summary
public static int floatToIntColor(float value)

Converts the color from a float ABGR encoding to an int ABGR encoding. The alpha is expanded from 0-254 in the float encoding (see intToFloatColor(int)) to 0-255, which means converting from int to float and back to int can be lossy.

floatToRawIntBitsback to summary
public static int floatToRawIntBits(float value)
intBitsToFloatback to summary
public static float intBitsToFloat(int value)
intToFloatColorback to summary
public static float intToFloatColor(int value)

Encodes the ABGR int color as a float. The alpha is compressed to use only even numbers between 0-254 to avoid using bits in the NaN range (see Float#intBitsToFloat(int) javadocs). Rendering which uses colors encoded as floats should expand the 0-254 back to 0-255, else colors cannot be fully opaque.

longBitsToDoubleback to summary
public static double longBitsToDouble(long value)