public class UnsignedByteFromFloat extends ToUnsignedByte
ByteBuffer
encoding a float type to unsigned byte type, as
expected in an Anchor VoxelBuffer
.
Only values in the range 0 <= value <= 255
are preserved. Any values outside this
range are clamped to 0
or 255
.
Any decimal component is dropped.
destinationSize, extent, sourceIncrement, sourceSize
Constructor and Description |
---|
UnsignedByteFromFloat() |
Modifier and Type | Method and Description |
---|---|
protected int |
bytesPerVoxel()
The number bytes to describe each source-voxel.
|
protected void |
copyChangeOrientation(ByteBuffer source,
boolean littleEndian,
int channelIndexRelative,
UnsignedByteBuffer destination,
OrientationChange orientationCorrection)
Copy the bytes, changing orientation.
|
protected void |
copyKeepOrientation(ByteBuffer source,
boolean littleEndian,
int channelIndexRelative,
UnsignedByteBuffer destination)
Copy the bytes, without changing orientation.
|
protected boolean |
supportsMultipleChannelsPerSourceBuffer()
Whether the source buffer can encode more than one channel?
|
convert, convertSliceOfSingleChannel, copyAllChannels, setupBefore
protected int bytesPerVoxel()
ConvertTo
bytesPerVoxel
in class ConvertTo<UnsignedByteBuffer>
protected boolean supportsMultipleChannelsPerSourceBuffer()
ConvertTo
supportsMultipleChannelsPerSourceBuffer
in class ConvertTo<UnsignedByteBuffer>
protected void copyKeepOrientation(ByteBuffer source, boolean littleEndian, int channelIndexRelative, UnsignedByteBuffer destination)
ConvertTo
This is kept separate to ConvertTo.copyChangeOrientation(java.nio.ByteBuffer, boolean, int, T, org.anchoranalysis.image.core.dimensions.OrientationChange)
as it can be done slightly more
efficiently.
copyKeepOrientation
in class ConvertTo<UnsignedByteBuffer>
protected void copyChangeOrientation(ByteBuffer source, boolean littleEndian, int channelIndexRelative, UnsignedByteBuffer destination, OrientationChange orientationCorrection)
ConvertTo
copyChangeOrientation
in class ConvertTo<UnsignedByteBuffer>
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.