Class VoxelsConverterMulti
Object
VoxelsConverterMulti
Converts a channel from one voxel data-type to one of multiple other types.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<S,
T> Voxels <S> convert
(VoxelsUntyped voxels, VoxelsFactoryTypeBound<T> outputVoxelsFactory) Converts aVoxels
to another type.
-
Constructor Details
-
VoxelsConverterMulti
public VoxelsConverterMulti()
-
-
Method Details
-
convert
public <S,T> Voxels<S> convert(VoxelsUntyped voxels, VoxelsFactoryTypeBound<T> outputVoxelsFactory) Converts aVoxels
to another type.If
outputVoxelType
matches the existing data-type, the existingvoxels
is returned uncchanged.Otherwise a new
Voxels
of identical size is created for the new type.- Type Parameters:
S
- voxel data type to convert from.T
- voxel data type to convert to.- Parameters:
voxels
- the voxels to convert.outputVoxelsFactory
- a factory for creating the data-type to convert to.- Returns:
- a
Voxels
to matchoutputVoxelsFactory
, either reused (if already identical, or newly-created).
-