Class VoxelsConverter<T>

Object
VoxelsConverter<T>
Type Parameters:
T - destination-type (what the voxels will be converted to).
Direct Known Subclasses:
ToFloatNoScaling, ToUnsignedByte, ToUnsignedInt, ToUnsignedShortNoScaling, ToUnsignedShortScaleByType

public abstract class VoxelsConverter<T> extends Object
Converts voxels from one data-type to another.
Author:
Owen Feehan
  • Constructor Details

    • VoxelsConverter

      public VoxelsConverter()
  • Method Details

    • convertFrom

      public Voxels<T> convertFrom(VoxelsUntyped from, VoxelsFactoryTypeBound<T> factory)
      Creates a new voxels of type T and copies the voxels from from.
      Parameters:
      from - where the voxels are copied from (the source).
      factory - a factory that creates Voxels of type T.
      Returns:
      a newly created Voxels with values copied from source.
    • copyFrom

      public void copyFrom(VoxelsUntyped from, Voxels<T> to) throws OperationFailedException
      Copies voxels from a source (of any type) to voxels of type T.
      Parameters:
      from - where the voxels are copied from (the source)
      to - where the voxels are copied to (the destination)
      Throws:
      OperationFailedException - if the extents of from and to are not equal.
    • copyFromUnsignedByte

      public void copyFromUnsignedByte(Voxels<UnsignedByteBuffer> from, Voxels<T> to) throws OperationFailedException
      Copies voxels from a source of type @{link UnsignedByteBuffer} to voxels of type T.
      Parameters:
      from - where the voxels are copied from (the source).
      to - where the voxels are copied to (the destination).
      Throws:
      OperationFailedException - if the extents of from and to are not equal.
    • copyFromUnsignedShort

      public void copyFromUnsignedShort(Voxels<UnsignedShortBuffer> from, Voxels<T> to) throws OperationFailedException
      Copies voxels from a source of type @{link UnsignedShortBuffer} to voxels of type T.
      Parameters:
      from - where the voxels are copied from (the source).
      to - where the voxels are copied to (the destination).
      Throws:
      OperationFailedException - if the extents of from and to are not equal.
    • copyFromUnsignedInt

      public void copyFromUnsignedInt(Voxels<UnsignedIntBuffer> from, Voxels<T> to) throws OperationFailedException
      Copies voxels from a source of type @{link UnsignedIntBuffer} to voxels of type T.
      Parameters:
      from - where the voxels are copied from (the source).
      to - where the voxels are copied to (the destination).
      Throws:
      OperationFailedException - if the extents of from and to are not equal.
    • copyFromFloat

      public void copyFromFloat(Voxels<FloatBuffer> from, Voxels<T> to) throws OperationFailedException
      Copies voxels from a source of type @{link FloatBuffer} to voxels of type T.
      Parameters:
      from - where the voxels are copied from (the source).
      to - where the voxels are copied to (the destination).
      Throws:
      OperationFailedException - if the extents of from and to are not equal.
    • convertUnsignedByte

      protected abstract void convertUnsignedByte(UnsignedByteBuffer in, T out)
      Copies a value from the current position in a UnsignedByteBuffer to the current position in a buffer of type T.
      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.
    • convertUnsignedShort

      protected abstract void convertUnsignedShort(UnsignedShortBuffer in, T out)
      Copies a value from the current position in a UnsignedShortBuffer to the current position in a buffer of type T.
      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 abstract void convertUnsignedInt(UnsignedIntBuffer in, T out)
      Copies a value from the current position in a UnsignedIntBuffer to the current position in a buffer of type T.
      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 abstract void convertFloat(FloatBuffer in, T out)
      Copies a value from the current position in a FloatBuffer to the current position in a buffer of type T.
      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.