Class ToUnsignedByteScaleByMaxValue


public final class ToUnsignedByteScaleByMaxValue extends ToUnsignedByte
Converts voxel buffers to an unsigned 8-bit buffer linearly scaling against the maximum constant value.

The scaling occurs so that the full 8-bit range of values is supported.

Author:
Owen Feehan
  • Constructor Details

    • ToUnsignedByteScaleByMaxValue

      public ToUnsignedByteScaleByMaxValue(int maxValue)
      Creates with the maximum-value which existing values are scaled against.
      Parameters:
      maxValue - the maximum-value that will be represented in the scaled-values.
  • Method Details

    • setMaxValue

      public void setMaxValue(long maxValue)
      Assigns the maximum-value that will be represented in the scaled-values.
      Parameters:
      maxValue - the maximum-value.
    • convertUnsignedShort

      protected void convertUnsignedShort(UnsignedShortBuffer in, UnsignedByteBuffer out)
      Description copied from class: VoxelsConverter
      Copies a value from the current position in a UnsignedShortBuffer to the current position in a buffer of type T.
      Specified by:
      convertUnsignedShort in class VoxelsConverter<UnsignedByteBuffer>
      Parameters:
      in - the current position of this buffer gives the value to convert, and the position is incremented.
      out - the converted value is written to the current position of this buffer, and the position is incremented.
    • convertUnsignedInt

      protected void convertUnsignedInt(UnsignedIntBuffer in, UnsignedByteBuffer out)
      Description copied from class: VoxelsConverter
      Copies a value from the current position in a UnsignedIntBuffer to the current position in a buffer of type T.
      Specified by:
      convertUnsignedInt in class VoxelsConverter<UnsignedByteBuffer>
      Parameters:
      in - the current position of this buffer gives the value to convert, and the position is incremented.
      out - the converted value is written to the current position of this buffer, and the position is incremented.
    • convertFloat

      protected void convertFloat(FloatBuffer in, UnsignedByteBuffer out)
      Description copied from class: VoxelsConverter
      Copies a value from the current position in a FloatBuffer to the current position in a buffer of type T.
      Specified by:
      convertFloat in class VoxelsConverter<UnsignedByteBuffer>
      Parameters:
      in - the current position of this buffer gives the value to convert, and the position is incremented.
      out - the converted value is written to the current position of this buffer, and the position is incremented.