Class Unsigned2BitType

All Implemented Interfaces:
Comparable<Unsigned2BitType>, NativeType<Unsigned2BitType>, ComplexType<Unsigned2BitType>, IntegerType<Unsigned2BitType>, NumericType<Unsigned2BitType>, RealType<Unsigned2BitType>, Add<Unsigned2BitType>, Div<Unsigned2BitType>, Mul<Unsigned2BitType>, MulFloatingPoint, SetOne, SetZero, Sub<Unsigned2BitType>, ValueEquals<Unsigned2BitType>, Type<Unsigned2BitType>

public class Unsigned2BitType extends AbstractIntegerBitType<Unsigned2BitType>
A Type with a bit depth of 2. The performance of this type is traded off for the gain in memory storage.
Author:
Albert Cardona
  • Constructor Details

    • Unsigned2BitType

      public Unsigned2BitType(NativeImg<?,? extends LongAccess> bitStorage)
    • Unsigned2BitType

      public Unsigned2BitType(long value)
    • Unsigned2BitType

      public Unsigned2BitType(LongAccess access)
    • Unsigned2BitType

      public Unsigned2BitType()
  • Method Details

    • createSuitableNativeImg

      public NativeImg<Unsigned2BitType,? extends LongAccess> createSuitableNativeImg(NativeImgFactory<Unsigned2BitType> storageFactory, long[] dim)
      Description copied from interface: NativeType
      The NativeType creates the NativeImg used for storing image data; based on the given storage strategy and its size. It basically only decides here which BasicType it uses (float, int, byte, bit, ...) and how many entities per pixel it needs (e.g. 2 floats per pixel for a complex number). This enables the separation of containers and the basic types.
      Parameters:
      storageFactory - which storage strategy is used
      dim - the dimensions
      Returns:
      the instantiated NativeImg where only the Type knows the BasicType it contains.
    • duplicateTypeOnSameNativeImg

      public Unsigned2BitType duplicateTypeOnSameNativeImg()
      Description copied from interface: NativeType
      Creates a new NativeType which stores in the same physical array. This is only used internally.
      Returns:
      a new NativeType instance working on the same NativeImg
    • get

      public long get()
      Specified by:
      get in class AbstractIntegerBitType<Unsigned2BitType>
    • set

      public void set(long value)
      Specified by:
      set in class AbstractIntegerBitType<Unsigned2BitType>
    • createVariable

      public Unsigned2BitType createVariable()
      Description copied from interface: Type
      Creates a new Type variable which can only store one value.
      Returns:
      a new Type variable
    • copy

      public Unsigned2BitType copy()
      Description copied from interface: Type
      Creates a new Type variable that has the value of this Type
      Returns:
      a new Type variable