Class UnsignedByteFromUnsignedByte

Object
ConvertTo<UnsignedByteBuffer>
ToUnsignedByte
UnsignedByteFromUnsignedByte
Direct Known Subclasses:
UnsignedByteFromUnsignedByteInterleaving, UnsignedByteFromUnsignedByteNoInterleaving

public abstract class UnsignedByteFromUnsignedByte extends ToUnsignedByte
Like ToUnsignedByte and provides common functionality when converting to an unsigned byte.

As this is the same as the source type, optimizations can occur to copy the existing memory without further manipulation.

Author:
Owen Feehan
  • Constructor Details

    • UnsignedByteFromUnsignedByte

      public UnsignedByteFromUnsignedByte()
  • Method Details

    • supportsMultipleChannelsPerSourceBuffer

      protected boolean supportsMultipleChannelsPerSourceBuffer()
      Description copied from class: ConvertTo
      Whether the source buffer can encode more than one channel?
      Specified by:
      supportsMultipleChannelsPerSourceBuffer in class ConvertTo<UnsignedByteBuffer>
      Returns:
      true if this possible (either with interleaving or with RGB-encoded voxels), false if a buffer will always describe one channel only.
    • 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.
    • convert

      protected UnsignedByteBuffer convert(ByteBuffer source, int channelIndexRelative, OrientationChange orientationCorrection, boolean littleEndian) throws IOException
      Description copied from class: ConvertTo
      Converts a slice of single-channel into a newly created buffer of type T T.
      Overrides:
      convert in class ConvertTo<UnsignedByteBuffer>
      Parameters:
      source - source buffer containing the bytes we copy from.
      channelIndexRelative - 0 if the buffer is non interleaved, or otherwise the index of the channel among the interleaved channels.
      orientationCorrection - any correction of orientation to be applied as bytes are converted.
      littleEndian - true iff the bytes in source are in little-endian order.
      Returns:
      the converted buffer.
      Throws:
      IOException - when operation is unsupported, given particular parameterization.