com.io7m.jcanephora.cursors

## Class JCGLRG8ByteBuffered

- java.lang.Object
- - com.io7m.jcanephora.cursors.JCGLRG8ByteBuffered

- All Implemented Interfaces:
    JCGLRG8ReadableType, JCGLRG8Type, JCGLRG8WritableType, com.io7m.jpra.runtime.java.JPRAValueType

      public final class JCGLRG8ByteBuffered
      extends Object
      implements JCGLRG8Type

  A `ByteBuffer` based implementation of the `JCGLRG8` packed type.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getG()`
    `int` | `getGRaw()`
    `double` | `getR()`
    `int` | `getRRaw()`
    `static JCGLRG8Type` | `newValue(ByteBuffer in_buffer, com.io7m.jpra.runtime.java.JPRACursorByteReadableType in_pointer)` Construct a view of a type.
    `static JCGLRG8Type` | `newValueWithOffset(ByteBuffer in_buffer, com.io7m.jpra.runtime.java.JPRACursorByteReadableType in_pointer, int in_base_offset)` Construct a view of a type.
    `void` | `set(double r, double g)` Set the value of all fields.
    `void` | `setG(double x)` Set the value of the `g` field.
    `void` | `setGRaw(int x)` Set the value of the `g` field.
    `void` | `setR(double x)` Set the value of the `r` field.
    `void` | `setRRaw(int x)` Set the value of the `r` field.
    `static int` | `sizeInOctets()`
    `int` | `sizeOctets()`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newValueWithOffset

          public static JCGLRG8Type newValueWithOffset(ByteBuffer in_buffer,
                                                       com.io7m.jpra.runtime.java.JPRACursorByteReadableType in_pointer,
                                                       int in_base_offset)

      Construct a view of a type.
      Parameters:
        `in_buffer` - A byte buffer
        `in_pointer` - A cursor
        `in_base_offset` - The base offset from the cursor
      Returns:
        A view of a type

    - #### newValue

          public static JCGLRG8Type newValue(ByteBuffer in_buffer,
                                             com.io7m.jpra.runtime.java.JPRACursorByteReadableType in_pointer)

      Construct a view of a type.
      Parameters:
        `in_buffer` - A byte buffer
        `in_pointer` - A cursor
      Returns:
        A view of a type

    - #### sizeOctets

          public int sizeOctets()

      Specified by:
        `sizeOctets` in interface `com.io7m.jpra.runtime.java.JPRAValueType`

    - #### sizeInOctets

          public static int sizeInOctets()

      Returns:
        The size of the type in octets

    - #### getRRaw

          public int getRRaw()

      Specified by:
        `getRRaw` in interface `JCGLRG8ReadableType`
      Returns:
        The value of the `r` field

    - #### setRRaw

          public void setRRaw(int x)

      Description copied from interface: `JCGLRG8WritableType`
      Set the value of the `r` field. The 8 least significant bits of `x` will be used.
      Specified by:
        `setRRaw` in interface `JCGLRG8WritableType`
      Parameters:
        `x` - The new value

    - #### getR

          public double getR()

      Specified by:
        `getR` in interface `JCGLRG8ReadableType`
      Returns:
        The value of the `r` field

    - #### setR

          public void setR(double x)

      Description copied from interface: `JCGLRG8WritableType`
      Set the value of the `r` field.
      Specified by:
        `setR` in interface `JCGLRG8WritableType`
      Parameters:
        `x` - The new value (in the range `[0, 1]`)

    - #### getGRaw

          public int getGRaw()

      Specified by:
        `getGRaw` in interface `JCGLRG8ReadableType`
      Returns:
        The value of the `g` field

    - #### setGRaw

          public void setGRaw(int x)

      Description copied from interface: `JCGLRG8WritableType`
      Set the value of the `g` field. The 8 least significant bits of `x` will be used.
      Specified by:
        `setGRaw` in interface `JCGLRG8WritableType`
      Parameters:
        `x` - The new value

    - #### getG

          public double getG()

      Specified by:
        `getG` in interface `JCGLRG8ReadableType`
      Returns:
        The value of the `g` field

    - #### setG

          public void setG(double x)

      Description copied from interface: `JCGLRG8WritableType`
      Set the value of the `g` field.
      Specified by:
        `setG` in interface `JCGLRG8WritableType`
      Parameters:
        `x` - The new value (in the range `[0, 1]`)

    - #### set

          public void set(double r,
                          double g)

      Description copied from interface: `JCGLRG8WritableType`
      Set the value of all fields.
      Specified by:
        `set` in interface `JCGLRG8WritableType`
      Parameters:
        `r` - The value for field `r`
        `g` - The value for field `g`

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