Skip to content

Commit b4d9161

Browse files
committed
Make ClampType global
1 parent fc6751d commit b4d9161

File tree

8 files changed

+18
-10
lines changed

8 files changed

+18
-10
lines changed

src/main/java/net/imglib2/algorithm/blocks/convert/ClampType.java renamed to src/main/java/net/imglib2/algorithm/blocks/ClampType.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
* %%
1212
* Redistribution and use in source and binary forms, with or without
1313
* modification, are permitted provided that the following conditions are met:
14-
*
14+
*
1515
* 1. Redistributions of source code must retain the above copyright notice,
1616
* this list of conditions and the following disclaimer.
1717
* 2. Redistributions in binary form must reproduce the above copyright notice,
1818
* this list of conditions and the following disclaimer in the documentation
1919
* and/or other materials provided with the distribution.
20-
*
20+
*
2121
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2222
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2323
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -31,10 +31,10 @@
3131
* POSSIBILITY OF SUCH DAMAGE.
3232
* #L%
3333
*/
34-
package net.imglib2.algorithm.blocks.convert;
34+
package net.imglib2.algorithm.blocks;
3535

3636
/**
37-
* How to clamp values when converting between {@link net.imglib2.algorithm.blocks.util.OperandType}.
37+
* How to clamp values when converting to target type.
3838
*/
3939
public enum ClampType
4040
{
@@ -48,8 +48,13 @@ public enum ClampType
4848
*/
4949
CLAMP,
5050

51+
/**
52+
* clamp only to lower bound
53+
*/
54+
CLAMP_MIN,
55+
5156
/**
5257
* clamp only to upper bound
5358
*/
54-
CLAMP_MAX;
59+
CLAMP_MAX
5560
}

src/main/java/net/imglib2/algorithm/blocks/UnaryBlockOperator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
*/
3434
package net.imglib2.algorithm.blocks;
3535

36-
import net.imglib2.algorithm.blocks.convert.ClampType;
3736
import net.imglib2.algorithm.blocks.convert.Convert;
3837
import net.imglib2.type.NativeType;
3938
import net.imglib2.util.Cast;

src/main/java/net/imglib2/algorithm/blocks/convert/Convert.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.util.function.Supplier;
3838

3939
import net.imglib2.algorithm.blocks.BlockSupplier;
40+
import net.imglib2.algorithm.blocks.ClampType;
4041
import net.imglib2.algorithm.blocks.DefaultUnaryBlockOperator;
4142
import net.imglib2.algorithm.blocks.UnaryBlockOperator;
4243
import net.imglib2.converter.Converter;

src/main/java/net/imglib2/algorithm/blocks/convert/ConvertBlockProcessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
import net.imglib2.Interval;
4141
import net.imglib2.algorithm.blocks.BlockProcessor;
42+
import net.imglib2.algorithm.blocks.ClampType;
4243
import net.imglib2.algorithm.blocks.util.BlockProcessorSourceInterval;
4344
import net.imglib2.algorithm.blocks.util.UnaryOperatorType;
4445
import net.imglib2.blocks.TempArray;

src/main/java/net/imglib2/algorithm/blocks/convert/ConvertLoops.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
*/
3434
package net.imglib2.algorithm.blocks.convert;
3535

36+
import net.imglib2.algorithm.blocks.ClampType;
3637
import net.imglib2.algorithm.blocks.util.UnaryOperatorType;
3738
import net.imglib2.util.Cast;
3839

src/main/java/net/imglib2/algorithm/blocks/downsample/Downsample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
* %%
1212
* Redistribution and use in source and binary forms, with or without
1313
* modification, are permitted provided that the following conditions are met:
14-
*
14+
*
1515
* 1. Redistributions of source code must retain the above copyright notice,
1616
* this list of conditions and the following disclaimer.
1717
* 2. Redistributions in binary form must reproduce the above copyright notice,
1818
* this list of conditions and the following disclaimer in the documentation
1919
* and/or other materials provided with the distribution.
20-
*
20+
*
2121
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2222
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2323
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -34,7 +34,7 @@
3434
package net.imglib2.algorithm.blocks.downsample;
3535

3636
import java.util.Arrays;
37-
import net.imglib2.algorithm.blocks.convert.ClampType;
37+
import net.imglib2.algorithm.blocks.ClampType;
3838
import net.imglib2.algorithm.blocks.downsample.DownsampleBlockProcessors.CenterDouble;
3939
import net.imglib2.algorithm.blocks.downsample.DownsampleBlockProcessors.CenterFloat;
4040
import net.imglib2.algorithm.blocks.downsample.DownsampleBlockProcessors.HalfPixelDouble;

src/main/java/net/imglib2/algorithm/blocks/transform/Transform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
import net.imglib2.algorithm.blocks.DefaultUnaryBlockOperator;
3737
import net.imglib2.algorithm.blocks.UnaryBlockOperator;
38-
import net.imglib2.algorithm.blocks.convert.ClampType;
38+
import net.imglib2.algorithm.blocks.ClampType;
3939
import net.imglib2.realtransform.AffineGet;
4040
import net.imglib2.realtransform.AffineTransform2D;
4141
import net.imglib2.realtransform.AffineTransform3D;

templates/main/java/net/imglib2/algorithm/blocks/ConvertLoops.vm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
*/
3434
package net.imglib2.algorithm.blocks.convert;
3535

36+
import net.imglib2.algorithm.blocks.ClampType;
3637
import net.imglib2.algorithm.blocks.util.UnaryOperatorType;
3738
import net.imglib2.util.Cast;
3839

0 commit comments

Comments
 (0)