Class ToUnsignedByteScaleByMaxValue
Converts voxel buffers to an unsigned 8-bit buffer linearly scaling against the maximum
constant value.
The scaling occurs so that the full 8-bit range of values is supported.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionToUnsignedByteScaleByMaxValue
(int maxValue) Creates with the maximum-value which existing values are scaled against. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
convertFloat
(FloatBuffer in, UnsignedByteBuffer out) Copies a value from the current position in aFloatBuffer
to the current position in a buffer of typeT
.protected void
Copies a value from the current position in aUnsignedIntBuffer
to the current position in a buffer of typeT
.protected void
Copies a value from the current position in aUnsignedShortBuffer
to the current position in a buffer of typeT
.void
setMaxValue
(long maxValue) Assigns the maximum-value that will be represented in the scaled-values.Methods inherited from class org.anchoranalysis.image.voxel.convert.ToUnsignedByte
convertUnsignedByte
Methods inherited from class org.anchoranalysis.image.voxel.convert.VoxelsConverter
convertFrom, copyFrom, copyFromFloat, copyFromUnsignedByte, copyFromUnsignedInt, copyFromUnsignedShort
-
Constructor Details
-
ToUnsignedByteScaleByMaxValue
public ToUnsignedByteScaleByMaxValue(int maxValue) Creates with the maximum-value which existing values are scaled against.- Parameters:
maxValue
- the maximum-value that will be represented in the scaled-values.
-
-
Method Details
-
setMaxValue
public void setMaxValue(long maxValue) Assigns the maximum-value that will be represented in the scaled-values.- Parameters:
maxValue
- the maximum-value.
-
convertUnsignedShort
Description copied from class:VoxelsConverter
Copies a value from the current position in aUnsignedShortBuffer
to the current position in a buffer of typeT
.- Specified by:
convertUnsignedShort
in classVoxelsConverter<UnsignedByteBuffer>
- Parameters:
in
- the current position of this buffer gives the value to convert, and the position is incremented.out
- the converted value is written to the current position of this buffer, and the position is incremented.
-
convertUnsignedInt
Description copied from class:VoxelsConverter
Copies a value from the current position in aUnsignedIntBuffer
to the current position in a buffer of typeT
.- Specified by:
convertUnsignedInt
in classVoxelsConverter<UnsignedByteBuffer>
- Parameters:
in
- the current position of this buffer gives the value to convert, and the position is incremented.out
- the converted value is written to the current position of this buffer, and the position is incremented.
-
convertFloat
Description copied from class:VoxelsConverter
Copies a value from the current position in aFloatBuffer
to the current position in a buffer of typeT
.- Specified by:
convertFloat
in classVoxelsConverter<UnsignedByteBuffer>
- Parameters:
in
- the current position of this buffer gives the value to convert, and the position is incremented.out
- the converted value is written to the current position of this buffer, and the position is incremented.
-