public abstract class ToUnsignedByteWithScaling extends ToUnsignedByte
ToUnsignedByte
but applies scaling, if necessary, to map the original value to
8-bits.Modifier and Type | Field and Description |
---|---|
protected ApplyScaling |
scaling |
destinationSize, extent, sourceIncrement, sourceSize
Modifier | Constructor and Description |
---|---|
protected |
ToUnsignedByteWithScaling(int effectiveBits)
Create with the number of bits that are used in the input-type.
|
Modifier and Type | Method and Description |
---|---|
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 abstract int |
extractScaledValue(byte[] sourceArray,
int index,
boolean littleEndian)
Extracts a value from the source-array, and apply any scaling and clamping.
|
protected boolean |
supportsMultipleChannelsPerSourceBuffer()
Whether the source buffer can encode more than one channel?
|
bytesPerVoxel, convert, convertSliceOfSingleChannel, copyAllChannels, setupBefore
protected ToUnsignedByteWithScaling(int effectiveBits)
e.g. 8 or 12 or 16.
This should always be a positive number.
If > 8
, then scaling is applied to values, to map them to the 8-bits available in
an unsigned-byte.
If <= 8
, then no scaling is applied.
effectiveBits
- the number of bits that are used in the input-byte, from which a scaling
factor is derived.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>
protected abstract int extractScaledValue(byte[] sourceArray, int index, boolean littleEndian)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.