Class VoxelsConverter<T>
Object
VoxelsConverter<T>
- Type Parameters:
T
- destination-type (what the voxels will be converted to).
- Direct Known Subclasses:
ToFloatNoScaling
,ToUnsignedByte
,ToUnsignedInt
,ToUnsignedShortNoScaling
,ToUnsignedShortScaleByType
Converts voxels from one data-type to another.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
convertFloat
(FloatBuffer in, T out) Copies a value from the current position in aFloatBuffer
to the current position in a buffer of typeT
.convertFrom
(VoxelsUntyped from, VoxelsFactoryTypeBound<T> factory) Creates a new voxels of typeT
and copies the voxels fromfrom
.protected abstract void
convertUnsignedByte
(UnsignedByteBuffer in, T out) Copies a value from the current position in aUnsignedByteBuffer
to the current position in a buffer of typeT
.protected abstract void
convertUnsignedInt
(UnsignedIntBuffer in, T out) Copies a value from the current position in aUnsignedIntBuffer
to the current position in a buffer of typeT
.protected abstract void
convertUnsignedShort
(UnsignedShortBuffer in, T out) Copies a value from the current position in aUnsignedShortBuffer
to the current position in a buffer of typeT
.void
copyFrom
(VoxelsUntyped from, Voxels<T> to) Copies voxels from a source (of any type) to voxels of typeT
.void
copyFromFloat
(Voxels<FloatBuffer> from, Voxels<T> to) Copies voxels from a source of type @{link FloatBuffer} to voxels of typeT
.void
copyFromUnsignedByte
(Voxels<UnsignedByteBuffer> from, Voxels<T> to) Copies voxels from a source of type @{link UnsignedByteBuffer} to voxels of typeT
.void
copyFromUnsignedInt
(Voxels<UnsignedIntBuffer> from, Voxels<T> to) Copies voxels from a source of type @{link UnsignedIntBuffer} to voxels of typeT
.void
copyFromUnsignedShort
(Voxels<UnsignedShortBuffer> from, Voxels<T> to) Copies voxels from a source of type @{link UnsignedShortBuffer} to voxels of typeT
.
-
Constructor Details
-
VoxelsConverter
public VoxelsConverter()
-
-
Method Details
-
convertFrom
Creates a new voxels of typeT
and copies the voxels fromfrom
. -
copyFrom
Copies voxels from a source (of any type) to voxels of typeT
.- Parameters:
from
- where the voxels are copied from (the source)to
- where the voxels are copied to (the destination)- Throws:
OperationFailedException
- if the extents offrom
andto
are not equal.
-
copyFromUnsignedByte
public void copyFromUnsignedByte(Voxels<UnsignedByteBuffer> from, Voxels<T> to) throws OperationFailedException Copies voxels from a source of type @{link UnsignedByteBuffer} to voxels of typeT
.- Parameters:
from
- where the voxels are copied from (the source).to
- where the voxels are copied to (the destination).- Throws:
OperationFailedException
- if the extents offrom
andto
are not equal.
-
copyFromUnsignedShort
public void copyFromUnsignedShort(Voxels<UnsignedShortBuffer> from, Voxels<T> to) throws OperationFailedException Copies voxels from a source of type @{link UnsignedShortBuffer} to voxels of typeT
.- Parameters:
from
- where the voxels are copied from (the source).to
- where the voxels are copied to (the destination).- Throws:
OperationFailedException
- if the extents offrom
andto
are not equal.
-
copyFromUnsignedInt
public void copyFromUnsignedInt(Voxels<UnsignedIntBuffer> from, Voxels<T> to) throws OperationFailedException Copies voxels from a source of type @{link UnsignedIntBuffer} to voxels of typeT
.- Parameters:
from
- where the voxels are copied from (the source).to
- where the voxels are copied to (the destination).- Throws:
OperationFailedException
- if the extents offrom
andto
are not equal.
-
copyFromFloat
Copies voxels from a source of type @{link FloatBuffer} to voxels of typeT
.- Parameters:
from
- where the voxels are copied from (the source).to
- where the voxels are copied to (the destination).- Throws:
OperationFailedException
- if the extents offrom
andto
are not equal.
-
convertUnsignedByte
Copies a value from the current position in aUnsignedByteBuffer
to the current position in a buffer of typeT
.- 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.
-
convertUnsignedShort
Copies a value from the current position in aUnsignedShortBuffer
to the current position in a buffer of typeT
.- 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
Copies a value from the current position in aUnsignedIntBuffer
to the current position in a buffer of typeT
.- 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
Copies a value from the current position in aFloatBuffer
to the current position in a buffer of typeT
.- 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.
-