public class Convert extends Object
UnaryBlockOperator to convert blocks between standard ImgLib2 Types.
Provides rounding, optional clamping, and handling unsigned types.
Supported types:
UnsignedByteTypeUnsignedShortTypeUnsignedIntTypeByteTypeShortTypeIntTypeLongTypeFloatTypeDoubleType| Constructor and Description |
|---|
Convert() |
| Modifier and Type | Method and Description |
|---|---|
static <S extends NativeType<S>,T extends NativeType<T>> |
convert(T targetType)
|
static <S extends NativeType<S>,T extends NativeType<T>> |
convert(T targetType,
ClampType clamp)
|
static <S extends NativeType<S>,T extends NativeType<T>> |
convert(T targetType,
Supplier<Converter<? super S,T>> converterSupplier)
|
static <S extends NativeType<S>,T extends NativeType<T>> |
createOperator(S sourceType,
T targetType)
|
static <S extends NativeType<S>,T extends NativeType<T>> |
createOperator(S sourceType,
T targetType,
ClampType clamp)
|
static <S extends NativeType<S>,T extends NativeType<T>> |
createOperator(S sourceType,
T targetType,
Supplier<Converter<? super S,T>> converterSupplier)
Create
UnaryBlockOperator to convert blocks between sourceType and targetType with the specified Converter. |
public static <S extends NativeType<S>,T extends NativeType<T>> Function<BlockSupplier<S>,UnaryBlockOperator<S,T>> convert(T targetType)
UnaryBlockOperator to convert blocks from S to
T.
Supported source/target types are ByteType, UnsignedByteType, ShortType, UnsignedShortType, IntType, UnsignedIntType, LongType, UnsignedLongType, FloatType, and DoubleType.
Target values are not clamped, so overflow may occur if the source type has a larger range than the target type.
The returned factory function creates an operator matching the type
S of the given input BlockSupplier<T>.
S - source typeT - target typetargetType - an instance of the target typeUnaryBlockOperator to convert blocks from S to Tpublic static <S extends NativeType<S>,T extends NativeType<T>> Function<BlockSupplier<S>,UnaryBlockOperator<S,T>> convert(T targetType, ClampType clamp)
UnaryBlockOperator to convert blocks from S to
T.
Supported source/target types are ByteType, UnsignedByteType, ShortType, UnsignedShortType, IntType, UnsignedIntType, LongType, UnsignedLongType, FloatType, and DoubleType.
If the target type cannot represent the full range of the source type,
values are clamped according to the specified ClampType.
The returned factory function creates an operator matching the type
S of the given input BlockSupplier<T>.
S - source typeT - target typetargetType - an instance of the target typeclamp - ClampTypeUnaryBlockOperator to convert blocks from S to Tpublic static <S extends NativeType<S>,T extends NativeType<T>> Function<BlockSupplier<S>,UnaryBlockOperator<S,T>> convert(T targetType, Supplier<Converter<? super S,T>> converterSupplier)
UnaryBlockOperator to convert blocks from S to
T with the specified Converter.
The returned factory function creates an operator matching the type
S of the given input BlockSupplier<T>.
S - source typeT - target typetargetType - an instance of the target typeconverterSupplier - creates new converter instancesUnaryBlockOperator to convert blocks from S to Tpublic static <S extends NativeType<S>,T extends NativeType<T>> UnaryBlockOperator<S,T> createOperator(S sourceType, T targetType)
public static <S extends NativeType<S>,T extends NativeType<T>> UnaryBlockOperator<S,T> createOperator(S sourceType, T targetType, ClampType clamp)
UnaryBlockOperator to convert blocks between sourceType and targetType.
Clamp target values according to clamp.public static <S extends NativeType<S>,T extends NativeType<T>> UnaryBlockOperator<S,T> createOperator(S sourceType, T targetType, Supplier<Converter<? super S,T>> converterSupplier)
UnaryBlockOperator to convert blocks between sourceType and targetType with the specified Converter.Copyright © 2009–2024 ImgLib2. All rights reserved.