Class BinaryVoxelsFactory

Object
BinaryVoxelsFactory

public class BinaryVoxelsFactory extends Object
Creates BinaryVoxels parameterized by size and initial state.
Author:
Owen Feehan
  • Method Details

    • createEmptyOn

      public static BinaryVoxels<UnsignedByteBuffer> createEmptyOn(Extent extent)
      Creates binary-voxels using unsigned 8-bit byte type and with all voxels set to on (255).
      Parameters:
      extent - the size of the voxels.
      Returns:
      newly created binary-voxels of specified size with all voxels initialized to on.
    • createEmptyOff

      public static BinaryVoxels<UnsignedByteBuffer> createEmptyOff(Extent extent)
      Creates binary-voxels using unsigned 8-bit byte type and with all voxels set to off (0).
      Parameters:
      extent - the size of the voxels.
      Returns:
      newly created binary-voxels of specified size with all voxels initialized to off.
    • createEmptyOff

      public static BinaryVoxels<?> createEmptyOff(Extent extent, VoxelDataType dataType) throws CreateException
      Creates an empty binary-voxels of a particular data-type with all voxels initialized to off. (0).
      Parameters:
      extent - the size of the voxels.
      dataType - the data-type of the underlying voxel-buffer, either unsigned-byte or unsigned-int.
      Returns:
      newly created empty binary-voxels of specified size (all voxels initialized to 0).
      Throws:
      CreateException - if an unsupported data-type is requested.
    • reuseByte

      public static BinaryVoxels<UnsignedByteBuffer> reuseByte(Voxels<UnsignedByteBuffer> voxels)
      Parameters:
      voxels - voxel-buffer to treat as binary (and internally reused).
      Returns:
      newly created binary-voxels reusing existing voxels internally.
    • reuseByte

      public static BinaryVoxels<UnsignedByteBuffer> reuseByte(Voxels<UnsignedByteBuffer> voxels, BinaryValuesInt binaryValues)
      Reuses an existing voxel-buffer (of type unsigned byte) as a binary-version which should have only two intensity-values representing off and on.

      No check occurs that only these intensity values exist.

      Parameters:
      voxels - voxel-buffer to treat as binary (and internally reused).
      binaryValues - how to interpret off and on states.
      Returns:
      newly created binary-voxels reusing existing voxels internally.
    • reuseInt

      public static BinaryVoxels<UnsignedIntBuffer> reuseInt(Voxels<UnsignedIntBuffer> voxels, BinaryValuesInt binaryValues)
      Reuses an existing voxel-buffer (of type unsigned int) as a binary-version which should have only two intensity-values representing off and on.

      No check occurs that only these intensity values exist.

      Parameters:
      voxels - voxel-buffer to treat as binary (and internally reused).
      binaryValues - how to interpret off and on states.
      Returns:
      newly created binary-voxels reusing existing voxels internally.