Class VoxelDataType

Object
VoxelDataType
Direct Known Subclasses:
FloatVoxelType, SignedVoxelType, UnsignedVoxelType

public abstract class VoxelDataType extends Object
The type of data that a single voxel represents in an image or related buffer.
Author:
Owen Feehan
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    A placeholder value for maxValue or minValue if the true maximum or minimum value cannot be expressed as a long.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VoxelDataType(int bitDepth, String typeIdentifier, long maxValue, long minValue)
    Creates a new VoxelDataType instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The number of bits required to represent a voxel.
    boolean
     
    int
     
    abstract boolean
    Whether the data-type represents an integer or floating-point?
    abstract boolean
    Whether the data-type is unsigned?
    long
    The maximum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.
    long
    The minimum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.
    int
    The number of bytes needed to represent this data-type.
    final String
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • VALUE_NOT_COMPATIBLE

      public static final long VALUE_NOT_COMPATIBLE
      A placeholder value for maxValue or minValue if the true maximum or minimum value cannot be expressed as a long.
      See Also:
  • Constructor Details

    • VoxelDataType

      public VoxelDataType(int bitDepth, String typeIdentifier, long maxValue, long minValue)
      Creates a new VoxelDataType instance.
      Parameters:
      bitDepth - The number of bits required to represent a voxel.
      typeIdentifier - A string to uniquely and compactly describe this type.
      maxValue - The maximum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.
      minValue - The minimum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isInteger

      public abstract boolean isInteger()
      Whether the data-type represents an integer or floating-point?
      Returns:
      true if the data-type represents integers only, false if it is float-point.
    • isUnsigned

      public abstract boolean isUnsigned()
      Whether the data-type is unsigned?
      Returns:
      true if the data-type is unsigned, false if it is signed.
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • numberBytes

      public int numberBytes()
      The number of bytes needed to represent this data-type.
      Returns:
      the number of bytes.
    • bitDepth

      public int bitDepth()
      The number of bits required to represent a voxel.
    • maxValue

      public long maxValue()
      The maximum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.
    • minValue

      public long minValue()
      The minimum value this type can represent, or VALUE_NOT_COMPATIBLE if it cannot be represented in a long.