Class UnsignedByteFromUnsignedByteNoInterleavingScale

Object
ConvertTo<UnsignedByteBuffer>
ToUnsignedByte
ToUnsignedByteWithScaling
UnsignedByteFromUnsignedByteNoInterleavingScale

public class UnsignedByteFromUnsignedByteNoInterleavingScale extends ToUnsignedByteWithScaling
Converts data of type unsigned byte to unsigned byte.

Scaling is always applied to map the range of effective-bits (how many bits are used) to an 8-bit range.

Computationally, it is preferable to use UnsignedByteFromUnsignedByteNoInterleaving if both source and destination are exactly 8-bit and unsigned.

Author:
Owen Feehan
  • Constructor Details

    • UnsignedByteFromUnsignedByteNoInterleavingScale

      public UnsignedByteFromUnsignedByteNoInterleavingScale(int effectiveBits)
      Create with a number of effective-bits.
      Parameters:
      effectiveBits - the number of bits that are used in the input-type e.g. 8 or 12 or 16.
  • Method Details

    • bytesPerVoxel

      protected int bytesPerVoxel()
      Description copied from class: ConvertTo
      The number bytes to describe each source-voxel.
      Specified by:
      bytesPerVoxel in class ConvertTo<UnsignedByteBuffer>
      Returns:
      the number of bytes.
    • extractScaledValue

      protected int extractScaledValue(byte[] sourceArray, int index, boolean littleEndian)
      Description copied from class: ToUnsignedByteWithScaling
      Extracts a value from the source-array, and apply any scaling and clamping.
      Specified by:
      extractScaledValue in class ToUnsignedByteWithScaling
      Parameters:
      sourceArray - the bytes from which some values are extracted.
      index - the offset in sourceArray from which a value is read.
      littleEndian - true iff the bytes in source are in little-endian order.
      Returns:
      the extracted value.