Class UnsignedByteFromUnsignedByte
- Direct Known Subclasses:
UnsignedByteFromUnsignedByteInterleaving
,UnsignedByteFromUnsignedByteNoInterleaving
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
-
Field Summary
Fields inherited from class org.anchoranalysis.io.bioformats.copyconvert.ConvertTo
destinationSize, extent, sourceIncrement, sourceSize
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
The number bytes to describe each source-voxel.protected UnsignedByteBuffer
convert
(ByteBuffer source, int channelIndexRelative, OrientationChange orientationCorrection, boolean littleEndian) Converts a slice of single-channel into a newly created buffer of type TT
.protected boolean
Whether the source buffer can encode more than one channel?Methods inherited from class org.anchoranalysis.io.bioformats.copyconvert.ConvertTo
convertSliceOfSingleChannel, copyAllChannels, copyChangeOrientation, copyKeepOrientation, setupBefore
-
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 classConvertTo<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 classConvertTo<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 TT
.- Overrides:
convert
in classConvertTo<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 insource
are in little-endian order.- Returns:
- the converted buffer.
- Throws:
IOException
- when operation is unsupported, given particular parameterization.
-