Class VectorConverters

java.lang.Object
uk.co.parnmatt.vector.convert.VectorConverters

public final class VectorConverters extends Object
Collection of converters between vector element types
Since:
0.4.0
  • Method Details

    • unsignedBytesToShorts

      public static short[] unsignedBytesToShorts(byte... vector)
      Reinterprets each signed byte as an unsigned value [0, 255] widened into a short
      Parameters:
      vector - the byte vector to reinterpret
      Returns:
      the reinterpreted short vector
      Since:
      0.5.0
    • bytesToFloats

      public static float[] bytesToFloats(byte... vector)
      Converts a byte vector into a float vector
      Parameters:
      vector - the byte vector to convert
      Returns:
      the converted float vector
      Since:
      0.5.0
    • shortsToFloats

      public static float[] shortsToFloats(short... vector)
      Converts a short vector into a float vector
      Parameters:
      vector - the short vector to convert
      Returns:
      the converted float vector
      Since:
      0.5.0
    • intsToFloats

      public static float[] intsToFloats(int... vector)
      Converts an int vector into a float vector
      Parameters:
      vector - the int vector to convert
      Returns:
      the converted float vector
      Since:
      0.5.0
    • longsToFloats

      public static float[] longsToFloats(long... vector)
      Converts a long vector into a float vector
      Parameters:
      vector - the long vector to convert
      Returns:
      the converted float vector
      Since:
      0.5.0
    • doublesToFloats

      public static float[] doublesToFloats(double... vector)
      Converts a double vector into a float vector
      Parameters:
      vector - the double vector to convert
      Returns:
      the converted float vector
      Since:
      0.5.0