Class VoxelsFactory


public class VoxelsFactory extends VoxelDataTypeFactoryMultiplexer<VoxelsFactoryTypeBound<?>>
Creates VoxelsUntyped and provides a singleton location for implementations of VoxelsFactoryTypeBound for different types.
Author:
Owen Feehan
  • Method Details

    • instance

      public static VoxelsFactory instance()
      Singleton instance.
      Returns:
      a single instance of this class.
    • createFrom

      public <T> VoxelsUntyped createFrom(SliceBufferIndex<T> buffer, VoxelDataType dataType)
      Creates voxels from a particular SliceBufferIndex with specified type.
      Type Parameters:
      T - the buffer-type to use in the voxels.
      Parameters:
      buffer - the buffer to create a VoxelsUntyped from.
      dataType - the data-type that should be compatible with T.
      Returns:
      a newly created VoxelsUntyped that reuses the memory in buffer.
    • createEmpty

      public VoxelsUntyped createEmpty(Extent extent, VoxelDataType dataType)
      Creates empty voxels to match a particular size.
      Parameters:
      extent - the size of the VoxelsUntyped to create.
      dataType - the voxel data-type to create.
      Returns:
      the created voxels.
    • getUnsignedByte

      public static VoxelsFactoryTypeBound<UnsignedByteBuffer> getUnsignedByte()
      A factory that creates voxels of type unsigned byte.
      Returns:
      the corresponding factory.
    • getUnsignedShort

      public static VoxelsFactoryTypeBound<UnsignedShortBuffer> getUnsignedShort()
      A factory that creates voxels of type unsigned short.
      Returns:
      the corresponding factory.
    • getUnsignedInt

      public static VoxelsFactoryTypeBound<UnsignedIntBuffer> getUnsignedInt()
      A factory that creates voxels of type unsigned int.
      Returns:
      the corresponding factory.
    • getFloat

      public static VoxelsFactoryTypeBound<FloatBuffer> getFloat()
      A factory that creates voxels of type float.
      Returns:
      the corresponding factory.