Class ToUnsignedByteScaleByMinMaxValue

Object
VoxelsConverter<UnsignedByteBuffer>
ToUnsignedByte
ToUnsignedByteScaleByMinMaxValue

public final class ToUnsignedByteScaleByMinMaxValue extends ToUnsignedByte
Converts voxel buffers to an unsigned 8-bit buffer scaling against a the minimum and maximum constant.

The scaling is linear between these two boundaries.

Author:
Owen Feehan
  • Constructor Details

    • ToUnsignedByteScaleByMinMaxValue

      public ToUnsignedByteScaleByMinMaxValue(long minValue, long maxValue)
      Creates with the minimum- and maximum-values which existing values are scaled against.
      Parameters:
      minValue - the minimum-value that will be represented in the scaled-values (inclusive).
      maxValue - the maximum-value that will be represented in the scaled-values (inclusive).
  • Method Details

    • setMinMaxValues

      public void setMinMaxValues(long minValue, long maxValue)
      Assigns the minimum- and maximum-values which existing values are scaled against.
      Parameters:
      minValue - the minimum-value that will be represented in the scaled-values.
      maxValue - the maximum-value that will be represented in the scaled-values.
    • 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.