Class VectorConverters
java.lang.Object
uk.co.parnmatt.vector.convert.VectorConverters
Collection of converters between vector element types
- Since:
- 0.4.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic float[]bytesToFloats(byte... vector) Converts abytevector into afloatvectorstatic float[]doublesToFloats(double... vector) Converts adoublevector into afloatvectorstatic float[]intsToFloats(int... vector) Converts anintvector into afloatvectorstatic float[]longsToFloats(long... vector) Converts alongvector into afloatvectorstatic float[]shortsToFloats(short... vector) Converts ashortvector into afloatvectorstatic short[]unsignedBytesToShorts(byte... vector) Reinterprets each signedbyteas an unsigned value [0, 255] widened into ashort
-
Method Details
-
unsignedBytesToShorts
public static short[] unsignedBytesToShorts(byte... vector) Reinterprets each signedbyteas an unsigned value [0, 255] widened into ashort- Parameters:
vector- thebytevector to reinterpret- Returns:
- the reinterpreted
shortvector - Since:
- 0.5.0
-
bytesToFloats
public static float[] bytesToFloats(byte... vector) Converts abytevector into afloatvector- Parameters:
vector- thebytevector to convert- Returns:
- the converted
floatvector - Since:
- 0.5.0
-
shortsToFloats
public static float[] shortsToFloats(short... vector) Converts ashortvector into afloatvector- Parameters:
vector- theshortvector to convert- Returns:
- the converted
floatvector - Since:
- 0.5.0
-
intsToFloats
public static float[] intsToFloats(int... vector) Converts anintvector into afloatvector- Parameters:
vector- theintvector to convert- Returns:
- the converted
floatvector - Since:
- 0.5.0
-
longsToFloats
public static float[] longsToFloats(long... vector) Converts alongvector into afloatvector- Parameters:
vector- thelongvector to convert- Returns:
- the converted
floatvector - Since:
- 0.5.0
-
doublesToFloats
public static float[] doublesToFloats(double... vector) Converts adoublevector into afloatvector- Parameters:
vector- thedoublevector to convert- Returns:
- the converted
floatvector - Since:
- 0.5.0
-