From 3db98edec8913839091c303337bcf6c18564c8c9 Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Sun, 15 Sep 2024 12:44:59 +0200 Subject: [PATCH] Add javadoc --- .../algorithm/blocks/AbstractBlockSupplier.java | 2 ++ .../blocks/DefaultUnaryBlockOperator.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/main/java/net/imglib2/algorithm/blocks/AbstractBlockSupplier.java b/src/main/java/net/imglib2/algorithm/blocks/AbstractBlockSupplier.java index df35e3784..7d5b7a0f5 100644 --- a/src/main/java/net/imglib2/algorithm/blocks/AbstractBlockSupplier.java +++ b/src/main/java/net/imglib2/algorithm/blocks/AbstractBlockSupplier.java @@ -6,6 +6,8 @@ import net.imglib2.util.CloseableThreadLocal; /** + * Boilerplate for {@link BlockSupplier} to simplify implementations. + *

* Implements {@link BlockSupplier#threadSafe()} as a wrapper that makes {@link * ThreadLocal} {@link BlockSupplier#independentCopy()} copies. */ diff --git a/src/main/java/net/imglib2/algorithm/blocks/DefaultUnaryBlockOperator.java b/src/main/java/net/imglib2/algorithm/blocks/DefaultUnaryBlockOperator.java index 1d7b34e1a..fdba81fcc 100644 --- a/src/main/java/net/imglib2/algorithm/blocks/DefaultUnaryBlockOperator.java +++ b/src/main/java/net/imglib2/algorithm/blocks/DefaultUnaryBlockOperator.java @@ -38,6 +38,23 @@ import net.imglib2.util.Cast; import net.imglib2.util.CloseableThreadLocal; +/** + * Default implementation of {@link UnaryBlockOperator}. + *

+ * If you implement a {@code BlockProcessor}, you typically wrap it with a + * {@code DefaultUnaryBlockOperator}, specifying the source {@code S} and target + * {@code T} ImgLib2 {@code NativeType}s corresponding to primitive array types + * {@code I} and {@code O}, and the number of source and target dimension. + *

+ * The {@link UnaryBlockOperator} can then be used in {@link + * BlockSupplier#andThen(UnaryBlockOperator)} chains in a type- and + * simensionality-safe manner. + * + * @param + * source type + * @param + * target type + */ public class DefaultUnaryBlockOperator< S extends NativeType< S >, T extends NativeType< T > > implements UnaryBlockOperator< S, T > { private final S sourceType;