com.io7m.jcanephora.core

## Enum JCGLScalarType

- java.lang.Object
- - java.lang.Enum<JCGLScalarType>
  - - com.io7m.jcanephora.core.JCGLScalarType

- All Implemented Interfaces:
    Serializable, Comparable<JCGLScalarType>

      public enum JCGLScalarType
      extends Enum<JCGLScalarType>

  Type-safe interface to scalar types.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `TYPE_BYTE` A signed 8-bit integer.
    `TYPE_FLOAT` A 32-bit floating-point value.
    `TYPE_HALF_FLOAT` A 16-bit floating-point value.
    `TYPE_INT` A signed 32-bit integer.
    `TYPE_SHORT` A signed 16-bit integer.
    `TYPE_UNSIGNED_BYTE` An unsigned 8-bit integer.
    `TYPE_UNSIGNED_INT` An unsigned 32-bit integer.
    `TYPE_UNSIGNED_SHORT` An unsigned 16-bit integer.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JCGLScalarType` | `fromScalarIntegral(JCGLScalarIntegralType s)` Convert the given scalar integral type to a scalar type.
    `static JCGLScalarType` | `fromScalarUnsigned(JCGLUnsignedType s)` Convert the given unsigned type to a scalar type.
    `int` | `getSizeBytes()`
    `boolean` | `shaderTypeConvertible(int elements, JCGLType type)`
    `static JCGLScalarType` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static JCGLScalarType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### TYPE_BYTE

          public static final JCGLScalarType TYPE_BYTE

      A signed 8-bit integer.

    - #### TYPE_HALF_FLOAT

          public static final JCGLScalarType TYPE_HALF_FLOAT

      A 16-bit floating-point value.

    - #### TYPE_FLOAT

          public static final JCGLScalarType TYPE_FLOAT

      A 32-bit floating-point value.

    - #### TYPE_INT

          public static final JCGLScalarType TYPE_INT

      A signed 32-bit integer.

    - #### TYPE_SHORT

          public static final JCGLScalarType TYPE_SHORT

      A signed 16-bit integer.

    - #### TYPE_UNSIGNED_BYTE

          public static final JCGLScalarType TYPE_UNSIGNED_BYTE

      An unsigned 8-bit integer.

    - #### TYPE_UNSIGNED_INT

          public static final JCGLScalarType TYPE_UNSIGNED_INT

      An unsigned 32-bit integer.

    - #### TYPE_UNSIGNED_SHORT

          public static final JCGLScalarType TYPE_UNSIGNED_SHORT

      An unsigned 16-bit integer.

  - ### Method Detail

    - #### values

          public static JCGLScalarType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (JCGLScalarType c : JCGLScalarType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static JCGLScalarType valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### shaderTypeConvertible

          public boolean shaderTypeConvertible(int elements,
                                               JCGLType type)

      Parameters:
        `elements` - The number of elements.
        `type` - The GLSL type.
      Returns:
        `true` iff the type described by `elements` elements of this type are convertible to the GLSL type `type`. As an example, `4` elements of type `float` are convertible to the GLSL type `vec4`, or `TYPE_FLOAT_VECTOR_4`. Most combinations are not convertible to any GLSL type.

    - #### getSizeBytes

          public int getSizeBytes()

      Returns:
        The size in bytes of values of the current type.
      Since:
        0.53.0

    - #### fromScalarIntegral

          public static JCGLScalarType fromScalarIntegral(JCGLScalarIntegralType s)

      Convert the given scalar integral type to a scalar type.
      Parameters:
        `s` - The scalar integral type
      Returns:
        A scalar type
      Since:
        0.53.1

    - #### fromScalarUnsigned

          public static JCGLScalarType fromScalarUnsigned(JCGLUnsignedType s)

      Convert the given unsigned type to a scalar type.
      Parameters:
        `s` - The unsigned type
      Returns:
        A scalar type
      Since:
        0.53.1

Copyright © 2016 <code@io7m.com> http://io7m.com