From 59100cfc32478d5d0240ff527380f26971571347 Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Fri, 29 Jul 2022 15:12:02 -0500 Subject: [PATCH 01/15] Add support for Booleans --- .../img/NativeLongAccessImgFactory.java | 1 + .../BooleanLongAccess.java | 44 +++++++++++++++++++ .../type/NativeLongAccessTypeFactory.java | 6 +++ 3 files changed, 51 insertions(+) create mode 100644 src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java diff --git a/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java b/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java index ac1e045..b024062 100644 --- a/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java +++ b/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java @@ -29,6 +29,7 @@ package net.imglib2.img; +import net.imglib2.img.basictypelongaccess.BooleanLongAccess; import net.imglib2.img.basictypelongaccess.ByteLongAccess; import net.imglib2.img.basictypelongaccess.CharLongAccess; import net.imglib2.img.basictypelongaccess.DoubleLongAccess; diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java new file mode 100644 index 0000000..31a89bc --- /dev/null +++ b/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java @@ -0,0 +1,44 @@ +/* + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ + +package net.imglib2.img.basictypelongaccess; + +import net.imglib2.img.basictypeaccess.BooleanAccess; + +/** + * TODO + * + * @author Gabriel Selzer + */ +public interface BooleanLongAccess extends BooleanAccess +{ + public boolean getValue( final long index ); + + public void setValue( final long index, final boolean value ); +} diff --git a/src/main/java/net/imglib2/type/NativeLongAccessTypeFactory.java b/src/main/java/net/imglib2/type/NativeLongAccessTypeFactory.java index a0899ba..03c3ff1 100644 --- a/src/main/java/net/imglib2/type/NativeLongAccessTypeFactory.java +++ b/src/main/java/net/imglib2/type/NativeLongAccessTypeFactory.java @@ -31,6 +31,7 @@ import java.util.function.Function; import net.imglib2.img.NativeLongAccessImg; +import net.imglib2.img.basictypelongaccess.BooleanLongAccess; import net.imglib2.img.basictypelongaccess.ByteLongAccess; import net.imglib2.img.basictypelongaccess.CharLongAccess; import net.imglib2.img.basictypelongaccess.DoubleLongAccess; @@ -107,6 +108,11 @@ public T createLinkedType( final NativeLongAccessImg< T, ? extends A > img ) return createLinkedType.apply( img ); } + public static < T extends NativeLongAccessType< T >, A extends BooleanLongAccess > NativeLongAccessTypeFactory< T, A > BOOLEAN( final Function< NativeLongAccessImg< T, ? extends A >, T > createLinkedType ) + { + return new NativeLongAccessTypeFactory<>( PrimitiveType.BOOLEAN, createLinkedType ); + } + public static < T extends NativeLongAccessType< T >, A extends ByteLongAccess > NativeLongAccessTypeFactory< T, A > BYTE( final Function< NativeLongAccessImg< T, ? extends A >, T > createLinkedType ) { return new NativeLongAccessTypeFactory<>( PrimitiveType.BYTE, createLinkedType ); From b4e56b5751d105b18a94996f0e2ce04fc5754e03 Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Fri, 29 Jul 2022 15:50:30 -0500 Subject: [PATCH 02/15] Convert ByteLongAccess -> NativeBool This is actually a much more useful way of doing things, particularly when wrapping NumPy data --- ...LongAccessTypeNativeBoolTypeConverter.java | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeNativeBoolTypeConverter.java diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeNativeBoolTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeNativeBoolTypeConverter.java new file mode 100644 index 0000000..acfc4f0 --- /dev/null +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeNativeBoolTypeConverter.java @@ -0,0 +1,83 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ +package net.imglib2.converter.readwrite.longaccess; + +import net.imglib2.Sampler; +import net.imglib2.converter.readwrite.SamplerConverter; +import net.imglib2.img.basictypeaccess.BooleanAccess; +import net.imglib2.img.basictypeaccess.ByteAccess; +import net.imglib2.type.logic.NativeBoolType; +import net.imglib2.type.numeric.integer.ByteLongAccessType; +import net.imglib2.type.numeric.integer.ByteType; + +/** + * A {@link SamplerConverter} that converts {@link ByteLongAccessType} into + * {@link NativeBoolType}. {@link NativeBoolType}s are fundamentally 8 bits, + * which is also the size of a {@link ByteType}; even sizes make this conversion + * sensical. + * + * @author Gabriel Selzer + */ +public class ByteLongAccessTypeNativeBoolTypeConverter implements SamplerConverter< ByteLongAccessType, NativeBoolType > +{ + + @Override + public NativeBoolType convert( final Sampler< ? extends ByteLongAccessType > sampler ) + { + return new NativeBoolType( new ConvertedAccess( sampler.get() ) ); + } + + public static class ConvertedAccess implements BooleanAccess + { + private static final byte ONE = ( byte ) 1; + + private static final byte ZERO = ( byte ) 0; + + private final ByteLongAccessType type; + + public ConvertedAccess( final ByteLongAccessType type ) + { + this.type = type; + } + + @Override + public boolean getValue( final int index ) + { + return type.get() > 0; + } + + @Override + public void setValue( final int index, final boolean value ) + { + type.set( value ? ONE : ZERO ); + } + + } + +} From 9ab2f9e9294c5dbb1e9491f333234abc08d1e026 Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Fri, 29 Jul 2022 16:20:19 -0500 Subject: [PATCH 03/15] Write a NativeBooleanUnsafe Since they are the same size as a ByteUnsafe, let's just wrap that --- .../unsafe/NativeBooleanUnsafe.java | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java new file mode 100644 index 0000000..8ff0a0e --- /dev/null +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java @@ -0,0 +1,105 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ +package net.imglib2.img.basictypelongaccess.unsafe; + +import net.imglib2.img.basictypeaccess.volatiles.VolatileBooleanAccess; +import net.imglib2.img.basictypelongaccess.BooleanLongAccess; + +public class NativeBooleanUnsafe + implements BooleanLongAccess, VolatileBooleanAccess +{ + private static final boolean DEFAULT_IS_VALID = true; + private static final byte ZERO = (byte) 0; + private static final byte ONE = (byte) 1; + + private final ByteUnsafe wrapped; + + public NativeBooleanUnsafe( final long address ) + { + this( address, null ); + } + + public NativeBooleanUnsafe( final long address, final boolean isValid ) + { + this( address, null, isValid ); + } + + public NativeBooleanUnsafe( final long address, final Object ownerReference ) + { + this( address, ownerReference, DEFAULT_IS_VALID ); + } + + public NativeBooleanUnsafe( final long address, final Object ownerReference, final boolean isValid ) + { + super(); + this.wrapped = new ByteUnsafe(address, ownerReference, isValid); + } + + @Override + public boolean getValue( final int index ) + { + return getValue( ( long ) index ); + } + + @Override + public void setValue( final int index, final boolean value ) + { + setValue( ( long ) index, value ); + } + + @Override + public boolean getValue( final long index ) + { + return wrapped.getValue(index) > 0; + } + + @Override + public void setValue( final long index, final boolean value ) + { + wrapped.setValue(index, value ? ONE : ZERO); + } + + public long getAddres() + { + return wrapped.getAddres(); + } + + @Override + public boolean isValid() + { + return wrapped.isValid(); + } + + @Override + public void finalize() throws Throwable + { + wrapped.finalize(); + } + +} From ae4ac68d8d87bfb8c9ce7ce2699170d5caa37d92 Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Mon, 1 Aug 2022 08:26:25 -0500 Subject: [PATCH 04/15] Add myself as author --- .../img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java index 8ff0a0e..d9165d5 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java @@ -31,6 +31,9 @@ import net.imglib2.img.basictypeaccess.volatiles.VolatileBooleanAccess; import net.imglib2.img.basictypelongaccess.BooleanLongAccess; +/** + * @author Gabriel Selzer + */ public class NativeBooleanUnsafe implements BooleanLongAccess, VolatileBooleanAccess { From ea0b2682f340e27fb237b02b25e26f49c95bd63d Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Wed, 3 Aug 2022 11:08:57 -0500 Subject: [PATCH 05/15] Test Unsafe classes --- pom.xml | 8 +++ .../unsafe/ByteUnsafeTest.java | 62 ++++++++++++++++++ .../unsafe/CharUnsafeTest.java | 63 +++++++++++++++++++ .../unsafe/DoubleUnsafeTest.java | 63 +++++++++++++++++++ .../unsafe/FloatUnsafeTest.java | 63 +++++++++++++++++++ .../basictypeaccess/unsafe/IntUnsafeTest.java | 63 +++++++++++++++++++ .../unsafe/LongUnsafeTest.java | 63 +++++++++++++++++++ .../unsafe/NativeBooleanUnsafeTest.java | 63 +++++++++++++++++++ .../unsafe/ShortUnsafeTest.java | 63 +++++++++++++++++++ 9 files changed, 511 insertions(+) create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/ByteUnsafeTest.java create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/CharUnsafeTest.java create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/DoubleUnsafeTest.java create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/FloatUnsafeTest.java create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/IntUnsafeTest.java create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/LongUnsafeTest.java create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/NativeBooleanUnsafeTest.java create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/ShortUnsafeTest.java diff --git a/pom.xml b/pom.xml index 094fa85..553bf36 100644 --- a/pom.xml +++ b/pom.xml @@ -98,5 +98,13 @@ net.imglib2 imglib2 + + + + junit + junit + test + + diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ByteUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ByteUnsafeTest.java new file mode 100644 index 0000000..f7674a9 --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ByteUnsafeTest.java @@ -0,0 +1,62 @@ +package net.imglib2.img.basictypeaccess.unsafe; + +import net.imglib2.img.basictypelongaccess.unsafe.ByteUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +/** + * Tests basic {@link ByteUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class ByteUnsafeTest +{ + + private ByteUnsafe b; + + private long address; + + private final Byte startingValue = 5; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + b = new ByteUnsafe( address ); + b.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( b.getAddres() ); + } + + @Test + public void testByteUnsafeGetValue() + { + assertEquals( ( long ) startingValue, b.getValue( 0 ) ); + } + + @Test + public void testByteUnsafeSetValue() + { + byte newValue = 6; + b.setValue( 0, newValue ); + assertEquals( newValue, b.getValue( 0 ) ); + } + + @Test + public void testByteUnsafeGetAddress() + { + assertEquals( address, b.getAddres() ); + } + +} diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/CharUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/CharUnsafeTest.java new file mode 100644 index 0000000..f6da859 --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/CharUnsafeTest.java @@ -0,0 +1,63 @@ +package net.imglib2.img.basictypeaccess.unsafe; + +import static org.junit.Assert.assertEquals; + +import net.imglib2.img.basictypelongaccess.unsafe.CharUnsafe; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; + +/** + * Tests basic {@link CharUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class CharUnsafeTest +{ + + private CharUnsafe c; + + private long address; + + private final Character startingValue = 'a'; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + c = new CharUnsafe( address ); + c.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( c.getAddres() ); + } + + @Test + public void testCharUnsafeGetValue() + { + assertEquals( ( long ) startingValue, c.getValue( 0 ) ); + } + + @Test + public void testCharUnsafeSetValue() + { + char newValue = 'b'; + c.setValue( 0, newValue ); + assertEquals( newValue, c.getValue( 0 ) ); + } + + @Test + public void testCharUnsafeGetAddress() + { + assertEquals( address, c.getAddres() ); + } + +} diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/DoubleUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/DoubleUnsafeTest.java new file mode 100644 index 0000000..4f5c802 --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/DoubleUnsafeTest.java @@ -0,0 +1,63 @@ +package net.imglib2.img.basictypeaccess.unsafe; + +import static org.junit.Assert.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import net.imglib2.img.basictypelongaccess.unsafe.DoubleUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; + +/** + * Tests basic {@link DoubleUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class DoubleUnsafeTest +{ + + private DoubleUnsafe d; + + private long address; + + private final Double startingValue = 5d; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + d = new DoubleUnsafe( address ); + d.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( d.getAddres() ); + } + + @Test + public void testDoubleUnsafeGetValue() + { + assertEquals( startingValue, d.getValue( 0 ), 1e-6 ); + } + + @Test + public void testDoubleUnsafeSetValue() + { + double newValue = 6d; + d.setValue( 0, newValue ); + assertEquals( newValue, d.getValue( 0 ), 1e-6 ); + } + + @Test + public void testDoubleUnsafeGetAddress() + { + assertEquals( address, d.getAddres() ); + } + +} diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/FloatUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/FloatUnsafeTest.java new file mode 100644 index 0000000..f5f9185 --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/FloatUnsafeTest.java @@ -0,0 +1,63 @@ +package net.imglib2.img.basictypeaccess.unsafe; + +import static org.junit.Assert.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import net.imglib2.img.basictypelongaccess.unsafe.FloatUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; + +/** + * Tests basic {@link FloatUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class FloatUnsafeTest +{ + + private FloatUnsafe f; + + private long address; + + private final Float startingValue = 5f; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + f = new FloatUnsafe( address ); + f.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( f.getAddres() ); + } + + @Test + public void testFloatUnsafeGetValue() + { + assertEquals( startingValue, f.getValue( 0 ), 1e-6 ); + } + + @Test + public void testFloatUnsafeSetValue() + { + float newValue = 6f; + f.setValue( 0, newValue ); + assertEquals( newValue, f.getValue( 0 ), 1e-6 ); + } + + @Test + public void testFloatUnsafeGetAddress() + { + assertEquals( address, f.getAddres() ); + } + +} diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/IntUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/IntUnsafeTest.java new file mode 100644 index 0000000..89c468c --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/IntUnsafeTest.java @@ -0,0 +1,63 @@ +package net.imglib2.img.basictypeaccess.unsafe; + +import static org.junit.Assert.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import net.imglib2.img.basictypelongaccess.unsafe.IntUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; + +/** + * Tests basic {@link IntUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class IntUnsafeTest +{ + + private IntUnsafe i; + + private long address; + + private final Integer startingValue = 5; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + i = new IntUnsafe( address ); + i.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( i.getAddres() ); + } + + @Test + public void testIntUnsafeGetValue() + { + assertEquals( ( long ) startingValue, i.getValue( 0 ) ); + } + + @Test + public void testIntUnsafeSetValue() + { + int newValue = 6; + i.setValue( 0, newValue ); + assertEquals( newValue, i.getValue( 0 ) ); + } + + @Test + public void testIntUnsafeGetAddress() + { + assertEquals( address, i.getAddres() ); + } + +} diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/LongUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/LongUnsafeTest.java new file mode 100644 index 0000000..4c4abe0 --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/LongUnsafeTest.java @@ -0,0 +1,63 @@ +package net.imglib2.img.basictypeaccess.unsafe; + +import static org.junit.Assert.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import net.imglib2.img.basictypelongaccess.unsafe.LongUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; + +/** + * Tests basic {@link LongUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class LongUnsafeTest +{ + + private LongUnsafe l; + + private long address; + + private final Long startingValue = 5L; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + l = new LongUnsafe( address ); + l.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( l.getAddres() ); + } + + @Test + public void testLongUnsafeGetValue() + { + assertEquals( ( long ) startingValue, l.getValue( 0 ) ); + } + + @Test + public void testLongUnsafeSetValue() + { + long newValue = 6L; + l.setValue( 0, newValue ); + assertEquals( ( long ) newValue, l.getValue( 0 ) ); + } + + @Test + public void testLongUnsafeGetAddress() + { + assertEquals( address, l.getAddres() ); + } + +} diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/NativeBooleanUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/NativeBooleanUnsafeTest.java new file mode 100644 index 0000000..ee495ae --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/NativeBooleanUnsafeTest.java @@ -0,0 +1,63 @@ +package net.imglib2.img.basictypeaccess.unsafe; + +import static org.junit.Assert.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import net.imglib2.img.basictypelongaccess.unsafe.NativeBooleanUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; + +/** + * Tests basic {@link NativeBooleanUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class NativeBooleanUnsafeTest +{ + + private NativeBooleanUnsafe b; + + private long address; + + private final Boolean startingValue = false; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + b = new NativeBooleanUnsafe( address ); + b.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( b.getAddres() ); + } + + @Test + public void testNativeBooleanUnsafeGetValue() + { + assertEquals( startingValue, b.getValue( 0 ) ); + } + + @Test + public void testNativeBooleanUnsafeSetValue() + { + boolean newValue = true; + b.setValue( 0, newValue ); + assertEquals( newValue, b.getValue( 0 ) ); + } + + @Test + public void testNativeBooleanUnsafeGetAddress() + { + assertEquals( address, b.getAddres() ); + } + +} diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ShortUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ShortUnsafeTest.java new file mode 100644 index 0000000..4195d62 --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ShortUnsafeTest.java @@ -0,0 +1,63 @@ +package net.imglib2.img.basictypeaccess.unsafe; + +import static org.junit.Assert.assertEquals; + +import net.imglib2.img.basictypelongaccess.unsafe.ShortUnsafe; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; + +/** + * Tests basic {@link ShortUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class ShortUnsafeTest +{ + + private ShortUnsafe s; + + private long address; + + private final Short startingValue = 5; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + s = new ShortUnsafe( address ); + s.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( s.getAddres() ); + } + + @Test + public void testShortUnsafeGetValue() + { + assertEquals( ( long ) startingValue, s.getValue( 0 ) ); + } + + @Test + public void testShortUnsafeSetValue() + { + short newValue = 6; + s.setValue( 0, newValue ); + assertEquals( newValue, s.getValue( 0 ) ); + } + + @Test + public void testShortUnsafeGetAddress() + { + assertEquals( address, s.getAddres() ); + } + +} From f6b3b729e744d7f31af8ff9fe4be4a9e52f2bfb1 Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Wed, 3 Aug 2022 13:18:19 -0500 Subject: [PATCH 06/15] Add Converter tests --- .../LongAccessTypeToTypeConverterTest.java | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 src/test/java/net/imglib2/converter/readwrite/longaccess/LongAccessTypeToTypeConverterTest.java diff --git a/src/test/java/net/imglib2/converter/readwrite/longaccess/LongAccessTypeToTypeConverterTest.java b/src/test/java/net/imglib2/converter/readwrite/longaccess/LongAccessTypeToTypeConverterTest.java new file mode 100644 index 0000000..651d956 --- /dev/null +++ b/src/test/java/net/imglib2/converter/readwrite/longaccess/LongAccessTypeToTypeConverterTest.java @@ -0,0 +1,211 @@ +package net.imglib2.converter.readwrite.longaccess; + +import net.imglib2.Sampler; +import net.imglib2.converter.readwrite.SamplerConverter; +import net.imglib2.type.logic.NativeBoolType; +import net.imglib2.type.numeric.complex.ComplexDoubleLongAccessType; +import net.imglib2.type.numeric.complex.ComplexDoubleType; +import net.imglib2.type.numeric.complex.ComplexFloatLongAccessType; +import net.imglib2.type.numeric.complex.ComplexFloatType; +import net.imglib2.type.numeric.integer.ByteLongAccessType; +import net.imglib2.type.numeric.integer.IntType; +import net.imglib2.type.numeric.integer.LongType; +import net.imglib2.type.numeric.integer.ShortLongAccessType; +import net.imglib2.type.numeric.integer.IntLongAccessType; +import net.imglib2.type.numeric.integer.LongLongAccessType; +import net.imglib2.type.numeric.integer.ByteType; +import net.imglib2.type.numeric.integer.ShortType; +import net.imglib2.type.numeric.integer.UnsignedByteLongAccessType; +import net.imglib2.type.numeric.integer.UnsignedByteType; +import net.imglib2.type.numeric.integer.UnsignedIntLongAccessType; +import net.imglib2.type.numeric.integer.UnsignedIntType; +import net.imglib2.type.numeric.integer.UnsignedLongLongAccessType; +import net.imglib2.type.numeric.integer.UnsignedLongType; +import net.imglib2.type.numeric.integer.UnsignedShortLongAccessType; +import net.imglib2.type.numeric.integer.UnsignedShortType; +import net.imglib2.type.numeric.real.FloatLongAccessType; +import net.imglib2.type.numeric.real.DoubleLongAccessType; +import net.imglib2.type.numeric.real.FloatType; +import net.imglib2.type.numeric.real.DoubleType; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +/** + * Tests the {@link SamplerConverter}s of this project + * + * @author Gabriel Selzer + */ +public class LongAccessTypeToTypeConverterTest +{ + + private static < T, U > U convert( T access, SamplerConverter< T, U > converter ) + { + Sampler< T > sampler = new Sampler< T >() + { + + @Override + public T get() + { + return access; + } + + @Override + public Sampler< T > copy() + { + return null; + } + }; + return converter.convert( sampler ); + } + + @Test + public void testNativeBoolean() + { + ByteLongAccessType access = new ByteLongAccessType( ( byte ) 4 ); + NativeBoolType converted = convert( access, new ByteLongAccessTypeNativeBoolTypeConverter() ); + boolean value = false; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( 0, access.get() ); + } + + @Test + public void testByte() + { + ByteLongAccessType access = new ByteLongAccessType( ( byte ) 4 ); + ByteType converted = convert( access, new ByteLongAccessTypeByteTypeConverter() ); + byte value = 5; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( value, access.get() ); + } + + @Test + public void testShort() + { + ShortLongAccessType access = new ShortLongAccessType( ( short ) 4 ); + ShortType converted = convert( access, new ShortLongAccessTypeShortTypeConverter() ); + short value = 5; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( value, access.get() ); + } + + @Test + public void testInteger() + { + IntLongAccessType access = new IntLongAccessType( 4 ); + IntType converted = convert( access, new IntLongAccessTypeIntTypeConverter() ); + int value = 5; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( value, access.get() ); + } + + @Test + public void testLong() + { + LongLongAccessType access = new LongLongAccessType( 4L ); + LongType converted = convert( access, new LongLongAccessTypeLongTypeConverter() ); + long value = 5L; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( value, access.get() ); + } + + @Test + public void testFloat() + { + FloatLongAccessType access = new FloatLongAccessType( 4f ); + FloatType converted = convert( access, new FloatLongAccessTypeFloatTypeConverter() ); + float value = 5f; + converted.set( value ); + assertEquals( value, converted.get(), 1e-6 ); + assertEquals( value, access.get(), 1e-6 ); + } + + @Test + public void testDouble() + { + DoubleLongAccessType access = new DoubleLongAccessType( 4d ); + DoubleType converted = convert( access, new DoubleLongAccessTypeDoubleTypeConverter() ); + double value = 5d; + converted.set( value ); + assertEquals( value, converted.get(), 1e-6 ); + assertEquals( value, access.get(), 1e-6 ); + } + + @Test + public void testComplexFloat() + { + ComplexFloatLongAccessType access = new ComplexFloatLongAccessType( 4f, 4f ); + ComplexFloatType converted = convert( access, new ComplexFloatLongAccessTypeComplexFloatTypeConverter() ); + float real = 5f; + float imag = 5f; + converted.set( real, imag ); + assertEquals( real, converted.getRealDouble(), 1e-6 ); + assertEquals( real, access.getRealDouble(), 1e-6 ); + assertEquals( imag, converted.getImaginaryDouble(), 1e-6 ); + assertEquals( imag, access.getImaginaryDouble(), 1e-6 ); + } + + @Test + public void testComplexDouble() + { + ComplexDoubleLongAccessType access = new ComplexDoubleLongAccessType( 4d, 4d ); + ComplexDoubleType converted = convert( access, new ComplexDoubleLongAccessTypeComplexDoubleTypeConverter() ); + double real = 5d; + double imag = 5d; + converted.set( real, imag ); + assertEquals( real, converted.getRealDouble(), 1e-6 ); + assertEquals( real, access.getRealDouble(), 1e-6 ); + assertEquals( imag, converted.getImaginaryDouble(), 1e-6 ); + assertEquals( imag, access.getImaginaryDouble(), 1e-6 ); + } + + @Test + public void testUnsignedByte() + { + UnsignedByteLongAccessType access = new UnsignedByteLongAccessType( 4 ); + UnsignedByteType converted = convert( access, new UnsignedByteLongAccessTypeUnsignedByteTypeConverter() ); + byte value = 5; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( value, access.get() ); + } + + @Test + public void testUnsignedShort() + { + UnsignedShortLongAccessType access = new UnsignedShortLongAccessType( 4 ); + UnsignedShortType converted = convert( access, new UnsignedShortLongAccessTypeUnsignedShortTypeConverter() ); + short value = 5; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( value, access.get() ); + } + + @Test + public void testUnsignedInteger() + { + UnsignedIntLongAccessType access = new UnsignedIntLongAccessType( 4 ); + UnsignedIntType converted = convert( access, new UnsignedIntLongAccessTypeUnsignedIntTypeConverter() ); + int value = 5; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( value, access.get() ); + } + + @Test + public void testUnsignedLong() + { + UnsignedLongLongAccessType access = new UnsignedLongLongAccessType( 4L ); + UnsignedLongType converted = convert( access, new UnsignedLongLongAccessTypeUnsignedLongTypeConverter() ); + long value = 5L; + converted.set( value ); + assertEquals( value, converted.get() ); + assertEquals( value, access.get() ); + } + +} From 1f2f1ae47ff15ff77ceff3b1a8034c6fa89ce00f Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Wed, 3 Aug 2022 16:12:50 -0500 Subject: [PATCH 07/15] Add more support for NativeBooleanUnsafe --- .../img/NativeLongAccessImgFactory.java | 1 + .../owning/OwningNativeBooleanUnsafe.java | 108 ++++++++++++++++++ .../imglib2/img/unsafe/UnsafeImgFactory.java | 9 ++ 3 files changed, 118 insertions(+) create mode 100644 src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java diff --git a/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java b/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java index b024062..20293ec 100644 --- a/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java +++ b/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java @@ -68,6 +68,7 @@ public NativeLongAccessImgFactory( final T t ) return type.createSuitableNativeImg( this, dim ); } + public abstract NativeLongAccessImg< T, ? extends BooleanLongAccess> createNativeBooleanInstance( long[] dimensions, Fraction entitiesPerPixel ); /* basic type containers */ public abstract NativeLongAccessImg< T, ? extends ByteLongAccess > createByteInstance( long[] dimensions, Fraction entitiesPerPixel ); diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java new file mode 100644 index 0000000..2ad6d84 --- /dev/null +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java @@ -0,0 +1,108 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ +package net.imglib2.img.basictypelongaccess.unsafe.owning; + +import net.imglib2.img.basictypeaccess.volatiles.VolatileBooleanAccess; +import net.imglib2.img.basictypelongaccess.BooleanLongAccess; +import net.imglib2.img.basictypelongaccess.unsafe.NativeBooleanUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeAccess; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; +import net.imglib2.type.PrimitiveType; + +public class OwningNativeBooleanUnsafe extends AbstractOwningUnsafe implements + BooleanLongAccess, UnsafeAccess, + VolatileBooleanAccess +{ + private static final boolean DEFAULT_IS_VALID = true; + + private final NativeBooleanUnsafe unsafe; + + private final long numEntities; + + public OwningNativeBooleanUnsafe( final long numEntities ) + { + this( numEntities, DEFAULT_IS_VALID ); + } + + public OwningNativeBooleanUnsafe( final long numEntities, final boolean isValid ) + { + super( UnsafeUtil.create( numEntities ) ); + this.unsafe = new NativeBooleanUnsafe( owner.getAddress(), this, isValid ); + this.numEntities = numEntities; + } + + @Override + public boolean getValue( final int index ) + { + return unsafe.getValue( index ); + } + + @Override + public void setValue( final int index, final boolean value ) + { + unsafe.setValue( index, value ); + } + + @Override + public boolean getValue( final long index ) + { + return unsafe.getValue( index ); + } + + @Override + public void setValue( final long index, final boolean value ) + { + unsafe.setValue( index, value ); + } + + @Override + public OwningNativeBooleanUnsafe createAccess( final long numEntities ) + { + return new OwningNativeBooleanUnsafe( numEntities, isValid() ); + } + + @Override + public PrimitiveType getType() + { + return PrimitiveType.BYTE; + } + + @Override + public long getSize() + { + return this.numEntities; + } + + @Override + public boolean isValid() + { + return unsafe.isValid(); + } + +} diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java b/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java index 476394a..9b3eee7 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java @@ -42,6 +42,7 @@ import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningFloatUnsafe; import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningIntUnsafe; import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningLongUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningNativeBooleanUnsafe; import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningShortUnsafe; import net.imglib2.type.NativeLongAccessType; import net.imglib2.type.NativeLongAccessTypeFactory; @@ -81,6 +82,14 @@ public static long numEntities( final long[] dimensions, final Fraction entities return numEntities; } + @Override + public UnsafeImg< T, OwningNativeBooleanUnsafe > createNativeBooleanInstance( final long[] dimensions, final Fraction entitiesPerPixel ) + { + final long numEntities = numEntities( dimensions, entitiesPerPixel ); + + return new UnsafeImg<>( new OwningNativeBooleanUnsafe( numEntities ), dimensions, entitiesPerPixel ); + } + @Override public UnsafeImg< T, OwningByteUnsafe > createByteInstance( final long[] dimensions, final Fraction entitiesPerPixel ) { From cfb55cfac6442925465a7a404b365761948e58e2 Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Tue, 16 Aug 2022 11:42:25 -0500 Subject: [PATCH 08/15] Move method below comment --- src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java b/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java index 20293ec..972ca3e 100644 --- a/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java +++ b/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java @@ -68,8 +68,9 @@ public NativeLongAccessImgFactory( final T t ) return type.createSuitableNativeImg( this, dim ); } - public abstract NativeLongAccessImg< T, ? extends BooleanLongAccess> createNativeBooleanInstance( long[] dimensions, Fraction entitiesPerPixel ); /* basic type containers */ + public abstract NativeLongAccessImg< T, ? extends BooleanLongAccess> createNativeBooleanInstance( long[] dimensions, Fraction entitiesPerPixel ); + public abstract NativeLongAccessImg< T, ? extends ByteLongAccess > createByteInstance( long[] dimensions, Fraction entitiesPerPixel ); public abstract NativeLongAccessImg< T, ? extends CharLongAccess > createCharInstance( long[] dimensions, Fraction entitiesPerPixel ); From 75eb6395a53d678b9dec85ade7196130d10aee2c Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Tue, 16 Aug 2022 11:47:53 -0500 Subject: [PATCH 09/15] Add Javadoc for LongAccesses --- .../net/imglib2/img/basictypelongaccess/BooleanLongAccess.java | 3 ++- .../net/imglib2/img/basictypelongaccess/ByteLongAccess.java | 3 ++- .../net/imglib2/img/basictypelongaccess/CharLongAccess.java | 3 ++- .../net/imglib2/img/basictypelongaccess/DoubleLongAccess.java | 3 ++- .../net/imglib2/img/basictypelongaccess/FloatLongAccess.java | 3 ++- .../net/imglib2/img/basictypelongaccess/IntLongAccess.java | 3 ++- .../net/imglib2/img/basictypelongaccess/LongLongAccess.java | 3 ++- .../net/imglib2/img/basictypelongaccess/ShortLongAccess.java | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java index 31a89bc..131e369 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java @@ -32,7 +32,8 @@ import net.imglib2.img.basictypeaccess.BooleanAccess; /** - * TODO + * A {@link BooleanAccess} that can also query indices representable by a + * {@code long} * * @author Gabriel Selzer */ diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/ByteLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/ByteLongAccess.java index 445ea68..33b6c3f 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/ByteLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/ByteLongAccess.java @@ -32,7 +32,8 @@ import net.imglib2.img.basictypeaccess.ByteAccess; /** - * TODO + * A {@link ByteAccess} that can also query indices representable by a + * {@code long} * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/CharLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/CharLongAccess.java index c5f777f..ffd7a78 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/CharLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/CharLongAccess.java @@ -32,7 +32,8 @@ import net.imglib2.img.basictypeaccess.CharAccess; /** - * TODO + * A {@link CharAccess} that can also query indices representable by a + * {@code long} * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/DoubleLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/DoubleLongAccess.java index 51ec954..f13fd3b 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/DoubleLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/DoubleLongAccess.java @@ -32,7 +32,8 @@ import net.imglib2.img.basictypeaccess.DoubleAccess; /** - * TODO + * A {@link DoubleAccess} that can also query indices representable by a + * {@code long} * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/FloatLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/FloatLongAccess.java index 8fecc49..8f59f77 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/FloatLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/FloatLongAccess.java @@ -32,7 +32,8 @@ import net.imglib2.img.basictypeaccess.FloatAccess; /** - * TODO + * A {@link FloatAccess} that can also query indices representable by a + * {@code long} * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/IntLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/IntLongAccess.java index 162a759..a879cd5 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/IntLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/IntLongAccess.java @@ -32,7 +32,8 @@ import net.imglib2.img.basictypeaccess.IntAccess; /** - * TODO + * A {@link IntAccess} that can also query indices representable by a + * {@code long} * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/LongLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/LongLongAccess.java index bf2caed..00bd23b 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/LongLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/LongLongAccess.java @@ -32,7 +32,8 @@ import net.imglib2.img.basictypeaccess.LongAccess; /** - * TODO + * A {@link LongAccess} that can also query indices representable by a + * {@code long} * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/ShortLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/ShortLongAccess.java index 5ed2f91..310b99d 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/ShortLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/ShortLongAccess.java @@ -32,7 +32,8 @@ import net.imglib2.img.basictypeaccess.ShortAccess; /** - * TODO + * A {@link ShortAccess} that can also query indices representable by a + * {@code long} * * @author Stephan Preibisch * @author Stephan Saalfeld From ac635a10da6c825cd906a9ce02d03d83f54de25c Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Tue, 16 Aug 2022 12:18:10 -0500 Subject: [PATCH 10/15] Provide some javadoc for NativeBooleanUnsafe --- .../unsafe/NativeBooleanUnsafe.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java index d9165d5..c751170 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java @@ -32,6 +32,9 @@ import net.imglib2.img.basictypelongaccess.BooleanLongAccess; /** + * A {@link BooleanLongAccess} that accesses memory, starting from + * {@code address}. + * * @author Gabriel Selzer */ public class NativeBooleanUnsafe @@ -58,6 +61,19 @@ public NativeBooleanUnsafe( final long address, final Object ownerReference ) this( address, ownerReference, DEFAULT_IS_VALID ); } + /** + * Standard {@link NativeBooleanUnsafe} constructor. + * + * @param address + * the address in memory to index from + * @param ownerReference + * a reference to another {@link Object} that can hold control + * over the memory starting at {@code address}. Can be used to + * ensure that the backing memory is not + * garbage-collected. + * @param isValid + * - denotes the validity of this {@link NativeBooleanUnsafe} + */ public NativeBooleanUnsafe( final long address, final Object ownerReference, final boolean isValid ) { super(); @@ -76,12 +92,27 @@ public void setValue( final int index, final boolean value ) setValue( ( long ) index, value ); } + /** + * Returns the boolean value at {@code index}. + * + * @param index + * the offset (in bytes) from {@code address}. + * @return the value at {@code index} + */ @Override public boolean getValue( final long index ) { return wrapped.getValue(index) > 0; } + /** + * Sets the value at {@code index}. + * + * @param index + * the offset (in bytes) from {@code address} + * @param value + * the boolean value to be set at {@code index} + */ @Override public void setValue( final long index, final boolean value ) { From 4bb95a6d3c0dbd57cf114787d6b4595181a51d59 Mon Sep 17 00:00:00 2001 From: Gabriel Selzer Date: Tue, 16 Aug 2022 12:43:33 -0500 Subject: [PATCH 11/15] Add javadoc to OwningNativeBooleanUnsafe --- .../unsafe/owning/OwningNativeBooleanUnsafe.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java index 2ad6d84..17888fe 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java @@ -35,6 +35,12 @@ import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; import net.imglib2.type.PrimitiveType; +/** + * A convenience wrapper for {@link NativeBooleanUnsafe} that uses itself as the + * owner of the memory accessed. + * + * @author Gabriel Selzer + */ public class OwningNativeBooleanUnsafe extends AbstractOwningUnsafe implements BooleanLongAccess, UnsafeAccess, VolatileBooleanAccess @@ -50,6 +56,14 @@ public OwningNativeBooleanUnsafe( final long numEntities ) this( numEntities, DEFAULT_IS_VALID ); } + /** + * The default {@link OwningNativeBooleanUnsafe} constructor + * + * @param numEntities + * the size (in number of indices) of the backing memory. + * @param isValid + * the validity of this {@link OwningNativeBooleanUnsafe} + */ public OwningNativeBooleanUnsafe( final long numEntities, final boolean isValid ) { super( UnsafeUtil.create( numEntities ) ); From 4652d2a3976b484df0f27b53dbe20e5bacbf595b Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Thu, 2 Feb 2023 12:50:57 -0600 Subject: [PATCH 12/15] Happy New Year 2023 --- LICENSE.txt | 2 +- .../converter/longaccess/ARGBConverter.java | 2 +- .../converter/longaccess/FloatConverter.java | 2 +- .../ARGBLongAccessTypeARGBTypeConverter.java | 2 +- .../ByteLongAccessTypeByteTypeConverter.java | 2 +- ...LongAccessTypeNativeBoolTypeConverter.java | 2 +- ...gAccessTypeComplexDoubleTypeConverter.java | 2 +- ...ngAccessTypeComplexFloatTypeConverter.java | 2 +- ...ubleLongAccessTypeDoubleTypeConverter.java | 2 +- ...FloatLongAccessTypeFloatTypeConverter.java | 2 +- .../IntLongAccessTypeIntTypeConverter.java | 2 +- .../LongLongAccessTypeLongTypeConverter.java | 2 +- ...ShortLongAccessTypeShortTypeConverter.java | 2 +- ...ngAccessTypeUnsignedByteTypeConverter.java | 2 +- ...ongAccessTypeUnsignedIntTypeConverter.java | 2 +- ...ngAccessTypeUnsignedLongTypeConverter.java | 2 +- ...gAccessTypeUnsignedShortTypeConverter.java | 2 +- .../img/AbstractNativeLongAccessImg.java | 2 +- .../net/imglib2/img/NativeLongAccessImg.java | 2 +- .../img/NativeLongAccessImgFactory.java | 2 +- .../imglib2/img/basictypeaccess/Accesses.java | 2 +- .../BooleanLongAccess.java | 6 ++-- .../basictypelongaccess/ByteLongAccess.java | 2 +- .../basictypelongaccess/CharLongAccess.java | 2 +- .../basictypelongaccess/DoubleLongAccess.java | 2 +- .../basictypelongaccess/FloatLongAccess.java | 2 +- .../basictypelongaccess/IntLongAccess.java | 2 +- .../basictypelongaccess/LongLongAccess.java | 2 +- .../basictypelongaccess/ShortLongAccess.java | 2 +- .../AbstractStridedUnsafeLongAccess.java | 2 +- .../unsafe/ByteUnsafe.java | 2 +- .../unsafe/CharUnsafe.java | 2 +- .../unsafe/DoubleUnsafe.java | 2 +- .../unsafe/FloatUnsafe.java | 2 +- .../basictypelongaccess/unsafe/IntUnsafe.java | 2 +- .../unsafe/LongUnsafe.java | 2 +- .../unsafe/NativeBooleanUnsafe.java | 6 ++-- .../unsafe/ShortUnsafe.java | 2 +- .../unsafe/UnsafeAccess.java | 2 +- .../unsafe/UnsafeAccessFactory.java | 2 +- .../unsafe/UnsafeUtil.java | 2 +- .../unsafe/owning/AbstractOwningUnsafe.java | 2 +- .../unsafe/owning/OwningByteUnsafe.java | 2 +- .../unsafe/owning/OwningCharUnsafe.java | 2 +- .../unsafe/owning/OwningDoubleUnsafe.java | 2 +- .../unsafe/owning/OwningFloatUnsafe.java | 2 +- .../unsafe/owning/OwningIntUnsafe.java | 2 +- .../unsafe/owning/OwningLongUnsafe.java | 2 +- .../owning/OwningNativeBooleanUnsafe.java | 2 +- .../unsafe/owning/OwningShortUnsafe.java | 2 +- .../wrapped/WrappedByteLongAccess.java | 2 +- .../wrapped/WrappedCharLongAccess.java | 2 +- .../wrapped/WrappedDoubleLongAccess.java | 2 +- .../wrapped/WrappedFloatLongAccess.java | 2 +- .../wrapped/WrappedIntLongAccess.java | 2 +- .../wrapped/WrappedLongLongAccess.java | 2 +- .../wrapped/WrappedShortLongAccess.java | 2 +- .../img/unsafe/AbstractUnsafeCursor.java | 2 +- .../AbstractUnsafeLocalizingCursor.java | 2 +- .../net/imglib2/img/unsafe/UnsafeCursor.java | 2 +- .../net/imglib2/img/unsafe/UnsafeImg.java | 2 +- .../imglib2/img/unsafe/UnsafeImgFactory.java | 2 +- .../net/imglib2/img/unsafe/UnsafeImgs.java | 2 +- .../img/unsafe/UnsafeLocalizingCursor.java | 2 +- .../UnsafeLocalizingSubIntervalCursor.java | 2 +- .../img/unsafe/UnsafeRandomAccess.java | 2 +- .../img/unsafe/UnsafeSubIntervalCursor.java | 2 +- .../type/AbstractNativeLongAccessType.java | 2 +- .../imglib2/type/NativeLongAccessType.java | 2 +- .../type/NativeLongAccessTypeFactory.java | 2 +- .../type/numeric/ARGBLongAccessType.java | 2 +- .../complex/ComplexDoubleLongAccessType.java | 2 +- .../complex/ComplexFloatLongAccessType.java | 2 +- .../numeric/integer/ByteLongAccessType.java | 2 +- .../integer/GenericByteLongAccessType.java | 2 +- .../integer/GenericIntLongAccessType.java | 2 +- .../integer/GenericLongLongAccessType.java | 2 +- .../integer/GenericShortLongAccessType.java | 2 +- .../numeric/integer/IntLongAccessType.java | 2 +- .../numeric/integer/LongLongAccessType.java | 2 +- .../numeric/integer/ShortLongAccessType.java | 2 +- .../integer/UnsignedByteLongAccessType.java | 2 +- .../integer/UnsignedIntLongAccessType.java | 2 +- .../integer/UnsignedLongLongAccessType.java | 2 +- .../integer/UnsignedShortLongAccessType.java | 2 +- .../numeric/real/DoubleLongAccessType.java | 2 +- .../numeric/real/FloatLongAccessType.java | 2 +- .../LongAccessTypeToTypeConverterTest.java | 28 +++++++++++++++++++ .../unsafe/ByteUnsafeTest.java | 28 +++++++++++++++++++ .../unsafe/CharUnsafeTest.java | 28 +++++++++++++++++++ .../unsafe/DoubleUnsafeTest.java | 28 +++++++++++++++++++ .../unsafe/FloatUnsafeTest.java | 28 +++++++++++++++++++ .../basictypeaccess/unsafe/IntUnsafeTest.java | 28 +++++++++++++++++++ .../unsafe/LongUnsafeTest.java | 28 +++++++++++++++++++ .../unsafe/NativeBooleanUnsafeTest.java | 28 +++++++++++++++++++ .../unsafe/ShortUnsafeTest.java | 28 +++++++++++++++++++ 96 files changed, 343 insertions(+), 91 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 4010f5c..8aba810 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2017 - 2021, Howard Hughes Medical Institute. +Copyright (c) 2017 - 2023, Howard Hughes Medical Institute. All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/src/main/java/net/imglib2/converter/longaccess/ARGBConverter.java b/src/main/java/net/imglib2/converter/longaccess/ARGBConverter.java index 0454341..7ee3114 100644 --- a/src/main/java/net/imglib2/converter/longaccess/ARGBConverter.java +++ b/src/main/java/net/imglib2/converter/longaccess/ARGBConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/longaccess/FloatConverter.java b/src/main/java/net/imglib2/converter/longaccess/FloatConverter.java index 7168822..c4d62ed 100644 --- a/src/main/java/net/imglib2/converter/longaccess/FloatConverter.java +++ b/src/main/java/net/imglib2/converter/longaccess/FloatConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/ARGBLongAccessTypeARGBTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/ARGBLongAccessTypeARGBTypeConverter.java index 4fe5019..6de19b3 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/ARGBLongAccessTypeARGBTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/ARGBLongAccessTypeARGBTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeByteTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeByteTypeConverter.java index cc5b866..5e90272 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeByteTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeByteTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeNativeBoolTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeNativeBoolTypeConverter.java index acfc4f0..902876e 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeNativeBoolTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/ByteLongAccessTypeNativeBoolTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/ComplexDoubleLongAccessTypeComplexDoubleTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/ComplexDoubleLongAccessTypeComplexDoubleTypeConverter.java index 4535fb8..a049561 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/ComplexDoubleLongAccessTypeComplexDoubleTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/ComplexDoubleLongAccessTypeComplexDoubleTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/ComplexFloatLongAccessTypeComplexFloatTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/ComplexFloatLongAccessTypeComplexFloatTypeConverter.java index 8086132..ef9bb30 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/ComplexFloatLongAccessTypeComplexFloatTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/ComplexFloatLongAccessTypeComplexFloatTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/DoubleLongAccessTypeDoubleTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/DoubleLongAccessTypeDoubleTypeConverter.java index 82796ba..0e561c1 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/DoubleLongAccessTypeDoubleTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/DoubleLongAccessTypeDoubleTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/FloatLongAccessTypeFloatTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/FloatLongAccessTypeFloatTypeConverter.java index 9d06e12..922350b 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/FloatLongAccessTypeFloatTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/FloatLongAccessTypeFloatTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/IntLongAccessTypeIntTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/IntLongAccessTypeIntTypeConverter.java index 90469bc..8d572d2 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/IntLongAccessTypeIntTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/IntLongAccessTypeIntTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/LongLongAccessTypeLongTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/LongLongAccessTypeLongTypeConverter.java index 17ae6c2..27dd391 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/LongLongAccessTypeLongTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/LongLongAccessTypeLongTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/ShortLongAccessTypeShortTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/ShortLongAccessTypeShortTypeConverter.java index 5ea77dd..b44040d 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/ShortLongAccessTypeShortTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/ShortLongAccessTypeShortTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedByteLongAccessTypeUnsignedByteTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedByteLongAccessTypeUnsignedByteTypeConverter.java index cb1b754..f906a43 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedByteLongAccessTypeUnsignedByteTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedByteLongAccessTypeUnsignedByteTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedIntLongAccessTypeUnsignedIntTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedIntLongAccessTypeUnsignedIntTypeConverter.java index f8111f0..3d40529 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedIntLongAccessTypeUnsignedIntTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedIntLongAccessTypeUnsignedIntTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedLongLongAccessTypeUnsignedLongTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedLongLongAccessTypeUnsignedLongTypeConverter.java index 9662435..3b891b4 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedLongLongAccessTypeUnsignedLongTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedLongLongAccessTypeUnsignedLongTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedShortLongAccessTypeUnsignedShortTypeConverter.java b/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedShortLongAccessTypeUnsignedShortTypeConverter.java index e500fdb..5ea078f 100644 --- a/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedShortLongAccessTypeUnsignedShortTypeConverter.java +++ b/src/main/java/net/imglib2/converter/readwrite/longaccess/UnsignedShortLongAccessTypeUnsignedShortTypeConverter.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/AbstractNativeLongAccessImg.java b/src/main/java/net/imglib2/img/AbstractNativeLongAccessImg.java index 29f8c31..7c1d9d0 100644 --- a/src/main/java/net/imglib2/img/AbstractNativeLongAccessImg.java +++ b/src/main/java/net/imglib2/img/AbstractNativeLongAccessImg.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/NativeLongAccessImg.java b/src/main/java/net/imglib2/img/NativeLongAccessImg.java index 6e77fd1..a05b6ed 100644 --- a/src/main/java/net/imglib2/img/NativeLongAccessImg.java +++ b/src/main/java/net/imglib2/img/NativeLongAccessImg.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java b/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java index 972ca3e..d66df58 100644 --- a/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java +++ b/src/main/java/net/imglib2/img/NativeLongAccessImgFactory.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypeaccess/Accesses.java b/src/main/java/net/imglib2/img/basictypeaccess/Accesses.java index a36227a..ea5cd52 100644 --- a/src/main/java/net/imglib2/img/basictypeaccess/Accesses.java +++ b/src/main/java/net/imglib2/img/basictypeaccess/Accesses.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java index 131e369..c5efc68 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/BooleanLongAccess.java @@ -2,17 +2,17 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/ByteLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/ByteLongAccess.java index 33b6c3f..0b7b476 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/ByteLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/ByteLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/CharLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/CharLongAccess.java index ffd7a78..83e2008 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/CharLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/CharLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/DoubleLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/DoubleLongAccess.java index f13fd3b..f762497 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/DoubleLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/DoubleLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/FloatLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/FloatLongAccess.java index 8f59f77..7bc62b7 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/FloatLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/FloatLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/IntLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/IntLongAccess.java index a879cd5..1a23009 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/IntLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/IntLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/LongLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/LongLongAccess.java index 00bd23b..7701665 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/LongLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/LongLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/ShortLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/ShortLongAccess.java index 310b99d..393b270 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/ShortLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/ShortLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/AbstractStridedUnsafeLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/AbstractStridedUnsafeLongAccess.java index c6af900..8c2d0ff 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/AbstractStridedUnsafeLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/AbstractStridedUnsafeLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/ByteUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/ByteUnsafe.java index 44fa976..e690121 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/ByteUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/ByteUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/CharUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/CharUnsafe.java index e49e4b2..2a14c2e 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/CharUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/CharUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/DoubleUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/DoubleUnsafe.java index 864f045..f1c0d98 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/DoubleUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/DoubleUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/FloatUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/FloatUnsafe.java index 9113bde..9550c07 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/FloatUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/FloatUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/IntUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/IntUnsafe.java index d6f5938..b05fcc2 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/IntUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/IntUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/LongUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/LongUnsafe.java index 57019f7..f471f11 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/LongUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/LongUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java index c751170..f50c455 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/NativeBooleanUnsafe.java @@ -2,17 +2,17 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/ShortUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/ShortUnsafe.java index fece6ac..5d0d148 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/ShortUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/ShortUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeAccess.java index 29036b7..bd624be 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeAccessFactory.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeAccessFactory.java index f8e1f91..0597d10 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeAccessFactory.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeAccessFactory.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeUtil.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeUtil.java index 5aa7161..eee0167 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeUtil.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/UnsafeUtil.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/AbstractOwningUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/AbstractOwningUnsafe.java index 172a1b5..fc73b04 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/AbstractOwningUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/AbstractOwningUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningByteUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningByteUnsafe.java index 7a439e6..37dde0d 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningByteUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningByteUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningCharUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningCharUnsafe.java index 83e8108..e424488 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningCharUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningCharUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningDoubleUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningDoubleUnsafe.java index 15a0fd2..0a2fca0 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningDoubleUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningDoubleUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningFloatUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningFloatUnsafe.java index 01a3c7e..7d1020a 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningFloatUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningFloatUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningIntUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningIntUnsafe.java index 7910df4..1ec7966 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningIntUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningIntUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningLongUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningLongUnsafe.java index be179b6..107e814 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningLongUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningLongUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java index 17888fe..8d117b6 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningNativeBooleanUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningShortUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningShortUnsafe.java index 53bdcfc..394cab7 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningShortUnsafe.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningShortUnsafe.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedByteLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedByteLongAccess.java index 2e2445c..6d6791a 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedByteLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedByteLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedCharLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedCharLongAccess.java index 20f6909..c45d8b4 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedCharLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedCharLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedDoubleLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedDoubleLongAccess.java index 9687ce3..12b479e 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedDoubleLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedDoubleLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java index a1e0f86..16b2e12 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedIntLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedIntLongAccess.java index a200a62..688a44d 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedIntLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedIntLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedLongLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedLongLongAccess.java index d1df048..9aa5ece 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedLongLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedLongLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedShortLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedShortLongAccess.java index dbd7e09..5d51bb6 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedShortLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedShortLongAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/AbstractUnsafeCursor.java b/src/main/java/net/imglib2/img/unsafe/AbstractUnsafeCursor.java index d792e17..4ac39f2 100644 --- a/src/main/java/net/imglib2/img/unsafe/AbstractUnsafeCursor.java +++ b/src/main/java/net/imglib2/img/unsafe/AbstractUnsafeCursor.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/AbstractUnsafeLocalizingCursor.java b/src/main/java/net/imglib2/img/unsafe/AbstractUnsafeLocalizingCursor.java index a386f10..ccea8c8 100644 --- a/src/main/java/net/imglib2/img/unsafe/AbstractUnsafeLocalizingCursor.java +++ b/src/main/java/net/imglib2/img/unsafe/AbstractUnsafeLocalizingCursor.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeCursor.java b/src/main/java/net/imglib2/img/unsafe/UnsafeCursor.java index 31f01cb..110f459 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeCursor.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeCursor.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeImg.java b/src/main/java/net/imglib2/img/unsafe/UnsafeImg.java index 365237c..861e25a 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeImg.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeImg.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java b/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java index 9b3eee7..f7a3c8b 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeImgs.java b/src/main/java/net/imglib2/img/unsafe/UnsafeImgs.java index e6b4a9b..c78902f 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeImgs.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeImgs.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeLocalizingCursor.java b/src/main/java/net/imglib2/img/unsafe/UnsafeLocalizingCursor.java index 008428a..2efa72d 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeLocalizingCursor.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeLocalizingCursor.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeLocalizingSubIntervalCursor.java b/src/main/java/net/imglib2/img/unsafe/UnsafeLocalizingSubIntervalCursor.java index d831525..c43784b 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeLocalizingSubIntervalCursor.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeLocalizingSubIntervalCursor.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeRandomAccess.java b/src/main/java/net/imglib2/img/unsafe/UnsafeRandomAccess.java index 9ef8993..3af69a4 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeRandomAccess.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeRandomAccess.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeSubIntervalCursor.java b/src/main/java/net/imglib2/img/unsafe/UnsafeSubIntervalCursor.java index 395c582..e048633 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeSubIntervalCursor.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeSubIntervalCursor.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/AbstractNativeLongAccessType.java b/src/main/java/net/imglib2/type/AbstractNativeLongAccessType.java index d568f1f..6c20b5f 100644 --- a/src/main/java/net/imglib2/type/AbstractNativeLongAccessType.java +++ b/src/main/java/net/imglib2/type/AbstractNativeLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/NativeLongAccessType.java b/src/main/java/net/imglib2/type/NativeLongAccessType.java index 92d01b5..db28214 100644 --- a/src/main/java/net/imglib2/type/NativeLongAccessType.java +++ b/src/main/java/net/imglib2/type/NativeLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/NativeLongAccessTypeFactory.java b/src/main/java/net/imglib2/type/NativeLongAccessTypeFactory.java index 03c3ff1..80bacd1 100644 --- a/src/main/java/net/imglib2/type/NativeLongAccessTypeFactory.java +++ b/src/main/java/net/imglib2/type/NativeLongAccessTypeFactory.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/ARGBLongAccessType.java b/src/main/java/net/imglib2/type/numeric/ARGBLongAccessType.java index 2e95a9f..8e3333d 100644 --- a/src/main/java/net/imglib2/type/numeric/ARGBLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/ARGBLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/complex/ComplexDoubleLongAccessType.java b/src/main/java/net/imglib2/type/numeric/complex/ComplexDoubleLongAccessType.java index 8b7ba10..a2410f1 100644 --- a/src/main/java/net/imglib2/type/numeric/complex/ComplexDoubleLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/complex/ComplexDoubleLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/complex/ComplexFloatLongAccessType.java b/src/main/java/net/imglib2/type/numeric/complex/ComplexFloatLongAccessType.java index 74577e0..7b3dff8 100644 --- a/src/main/java/net/imglib2/type/numeric/complex/ComplexFloatLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/complex/ComplexFloatLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/ByteLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/ByteLongAccessType.java index 407d336..690396a 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/ByteLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/ByteLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/GenericByteLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/GenericByteLongAccessType.java index 1d67b57..079fdae 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/GenericByteLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/GenericByteLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/GenericIntLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/GenericIntLongAccessType.java index 0069c5c..3e89e47 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/GenericIntLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/GenericIntLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/GenericLongLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/GenericLongLongAccessType.java index e917aeb..6b74977 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/GenericLongLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/GenericLongLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/GenericShortLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/GenericShortLongAccessType.java index 5f34016..85ca5c1 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/GenericShortLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/GenericShortLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/IntLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/IntLongAccessType.java index 925ef42..be632f3 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/IntLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/IntLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/LongLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/LongLongAccessType.java index fb303df..abb6479 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/LongLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/LongLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/ShortLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/ShortLongAccessType.java index 2610cc6..df5fe19 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/ShortLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/ShortLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/UnsignedByteLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/UnsignedByteLongAccessType.java index d496bf7..7f250ae 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/UnsignedByteLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/UnsignedByteLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/UnsignedIntLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/UnsignedIntLongAccessType.java index fe8a939..c507c66 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/UnsignedIntLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/UnsignedIntLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/UnsignedLongLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/UnsignedLongLongAccessType.java index 105fe3d..3440caf 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/UnsignedLongLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/UnsignedLongLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/integer/UnsignedShortLongAccessType.java b/src/main/java/net/imglib2/type/numeric/integer/UnsignedShortLongAccessType.java index 36dd3a7..3b63f5c 100644 --- a/src/main/java/net/imglib2/type/numeric/integer/UnsignedShortLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/integer/UnsignedShortLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/real/DoubleLongAccessType.java b/src/main/java/net/imglib2/type/numeric/real/DoubleLongAccessType.java index 3add611..8a72c74 100644 --- a/src/main/java/net/imglib2/type/numeric/real/DoubleLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/real/DoubleLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main/java/net/imglib2/type/numeric/real/FloatLongAccessType.java b/src/main/java/net/imglib2/type/numeric/real/FloatLongAccessType.java index 99c013f..81f1df0 100644 --- a/src/main/java/net/imglib2/type/numeric/real/FloatLongAccessType.java +++ b/src/main/java/net/imglib2/type/numeric/real/FloatLongAccessType.java @@ -2,7 +2,7 @@ * #%L * ImgLib2 data structures using Unsafe. * %% - * Copyright (C) 2017 - 2021 Howard Hughes Medical Institute. + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/test/java/net/imglib2/converter/readwrite/longaccess/LongAccessTypeToTypeConverterTest.java b/src/test/java/net/imglib2/converter/readwrite/longaccess/LongAccessTypeToTypeConverterTest.java index 651d956..e172e96 100644 --- a/src/test/java/net/imglib2/converter/readwrite/longaccess/LongAccessTypeToTypeConverterTest.java +++ b/src/test/java/net/imglib2/converter/readwrite/longaccess/LongAccessTypeToTypeConverterTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.converter.readwrite.longaccess; import net.imglib2.Sampler; diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ByteUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ByteUnsafeTest.java index f7674a9..be90709 100644 --- a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ByteUnsafeTest.java +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ByteUnsafeTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.img.basictypeaccess.unsafe; import net.imglib2.img.basictypelongaccess.unsafe.ByteUnsafe; diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/CharUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/CharUnsafeTest.java index f6da859..6e1999d 100644 --- a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/CharUnsafeTest.java +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/CharUnsafeTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.img.basictypeaccess.unsafe; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/DoubleUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/DoubleUnsafeTest.java index 4f5c802..dd8b538 100644 --- a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/DoubleUnsafeTest.java +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/DoubleUnsafeTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.img.basictypeaccess.unsafe; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/FloatUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/FloatUnsafeTest.java index f5f9185..4478252 100644 --- a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/FloatUnsafeTest.java +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/FloatUnsafeTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.img.basictypeaccess.unsafe; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/IntUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/IntUnsafeTest.java index 89c468c..a8d96a6 100644 --- a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/IntUnsafeTest.java +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/IntUnsafeTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.img.basictypeaccess.unsafe; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/LongUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/LongUnsafeTest.java index 4c4abe0..b2f626e 100644 --- a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/LongUnsafeTest.java +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/LongUnsafeTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.img.basictypeaccess.unsafe; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/NativeBooleanUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/NativeBooleanUnsafeTest.java index ee495ae..14160b4 100644 --- a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/NativeBooleanUnsafeTest.java +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/NativeBooleanUnsafeTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.img.basictypeaccess.unsafe; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ShortUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ShortUnsafeTest.java index 4195d62..391d556 100644 --- a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ShortUnsafeTest.java +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/ShortUnsafeTest.java @@ -1,3 +1,31 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ package net.imglib2.img.basictypeaccess.unsafe; import static org.junit.Assert.assertEquals; From fdcb43b29a2a44714e085c26177b5c32776834db Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Thu, 2 Feb 2023 12:52:09 -0600 Subject: [PATCH 13/15] Rename NativeBooleanUnsafe to BooleanUnsafe This class is the Unsafe analogue to ImgLib2 core's BooleanAccess class in the net.imglib2.img.basictypeaccess package. So it should be named BooleanUnsafe, same as e.g. int with IntAccess in core and IntLongAccess and IntUnsafe here in imglib2-unsafe. --- .../unsafe/BooleanUnsafe.java | 139 ++++++++++++++++++ .../unsafe/owning/OwningBooleanUnsafe.java | 122 +++++++++++++++ .../imglib2/img/unsafe/UnsafeImgFactory.java | 6 +- .../unsafe/BooleanUnsafeTest.java | 91 ++++++++++++ 4 files changed, 355 insertions(+), 3 deletions(-) create mode 100644 src/main/java/net/imglib2/img/basictypelongaccess/unsafe/BooleanUnsafe.java create mode 100644 src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningBooleanUnsafe.java create mode 100644 src/test/java/net/imglib2/img/basictypeaccess/unsafe/BooleanUnsafeTest.java diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/BooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/BooleanUnsafe.java new file mode 100644 index 0000000..6564b7b --- /dev/null +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/BooleanUnsafe.java @@ -0,0 +1,139 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ +package net.imglib2.img.basictypelongaccess.unsafe; + +import net.imglib2.img.basictypeaccess.volatiles.VolatileBooleanAccess; +import net.imglib2.img.basictypelongaccess.BooleanLongAccess; + +/** + * A {@link BooleanLongAccess} that accesses memory, starting from + * {@code address}. + * + * @author Gabriel Selzer + */ +public class BooleanUnsafe + implements BooleanLongAccess, VolatileBooleanAccess +{ + private static final boolean DEFAULT_IS_VALID = true; + private static final byte ZERO = (byte) 0; + private static final byte ONE = (byte) 1; + + private final ByteUnsafe wrapped; + + public BooleanUnsafe( final long address ) + { + this( address, null ); + } + + public BooleanUnsafe( final long address, final boolean isValid ) + { + this( address, null, isValid ); + } + + public BooleanUnsafe( final long address, final Object ownerReference ) + { + this( address, ownerReference, DEFAULT_IS_VALID ); + } + + /** + * Standard {@link BooleanUnsafe} constructor. + * + * @param address + * the address in memory to index from + * @param ownerReference + * a reference to another {@link Object} that can hold control + * over the memory starting at {@code address}. Can be used to + * ensure that the backing memory is not + * garbage-collected. + * @param isValid + * - denotes the validity of this {@link BooleanUnsafe} + */ + public BooleanUnsafe( final long address, final Object ownerReference, final boolean isValid ) + { + super(); + this.wrapped = new ByteUnsafe(address, ownerReference, isValid); + } + + @Override + public boolean getValue( final int index ) + { + return getValue( ( long ) index ); + } + + @Override + public void setValue( final int index, final boolean value ) + { + setValue( ( long ) index, value ); + } + + /** + * Returns the boolean value at {@code index}. + * + * @param index + * the offset (in bytes) from {@code address}. + * @return the value at {@code index} + */ + @Override + public boolean getValue( final long index ) + { + return wrapped.getValue(index) > 0; + } + + /** + * Sets the value at {@code index}. + * + * @param index + * the offset (in bytes) from {@code address} + * @param value + * the boolean value to be set at {@code index} + */ + @Override + public void setValue( final long index, final boolean value ) + { + wrapped.setValue(index, value ? ONE : ZERO); + } + + public long getAddres() + { + return wrapped.getAddres(); + } + + @Override + public boolean isValid() + { + return wrapped.isValid(); + } + + @Override + public void finalize() throws Throwable + { + wrapped.finalize(); + } + +} diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningBooleanUnsafe.java b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningBooleanUnsafe.java new file mode 100644 index 0000000..08497bd --- /dev/null +++ b/src/main/java/net/imglib2/img/basictypelongaccess/unsafe/owning/OwningBooleanUnsafe.java @@ -0,0 +1,122 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ +package net.imglib2.img.basictypelongaccess.unsafe.owning; + +import net.imglib2.img.basictypeaccess.volatiles.VolatileBooleanAccess; +import net.imglib2.img.basictypelongaccess.BooleanLongAccess; +import net.imglib2.img.basictypelongaccess.unsafe.BooleanUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeAccess; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; +import net.imglib2.type.PrimitiveType; + +/** + * A convenience wrapper for {@link BooleanUnsafe} that uses itself as the + * owner of the memory accessed. + * + * @author Gabriel Selzer + */ +public class OwningBooleanUnsafe extends AbstractOwningUnsafe implements + BooleanLongAccess, UnsafeAccess, + VolatileBooleanAccess +{ + private static final boolean DEFAULT_IS_VALID = true; + + private final BooleanUnsafe unsafe; + + private final long numEntities; + + public OwningBooleanUnsafe( final long numEntities ) + { + this( numEntities, DEFAULT_IS_VALID ); + } + + /** + * The default {@link OwningBooleanUnsafe} constructor + * + * @param numEntities + * the size (in number of indices) of the backing memory. + * @param isValid + * the validity of this {@link OwningBooleanUnsafe} + */ + public OwningBooleanUnsafe( final long numEntities, final boolean isValid ) + { + super( UnsafeUtil.create( numEntities ) ); + this.unsafe = new BooleanUnsafe( owner.getAddress(), this, isValid ); + this.numEntities = numEntities; + } + + @Override + public boolean getValue( final int index ) + { + return unsafe.getValue( index ); + } + + @Override + public void setValue( final int index, final boolean value ) + { + unsafe.setValue( index, value ); + } + + @Override + public boolean getValue( final long index ) + { + return unsafe.getValue( index ); + } + + @Override + public void setValue( final long index, final boolean value ) + { + unsafe.setValue( index, value ); + } + + @Override + public OwningBooleanUnsafe createAccess( final long numEntities ) + { + return new OwningBooleanUnsafe( numEntities, isValid() ); + } + + @Override + public PrimitiveType getType() + { + return PrimitiveType.BYTE; + } + + @Override + public long getSize() + { + return this.numEntities; + } + + @Override + public boolean isValid() + { + return unsafe.isValid(); + } + +} diff --git a/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java b/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java index f7a3c8b..ddf95b5 100644 --- a/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java +++ b/src/main/java/net/imglib2/img/unsafe/UnsafeImgFactory.java @@ -42,7 +42,7 @@ import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningFloatUnsafe; import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningIntUnsafe; import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningLongUnsafe; -import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningNativeBooleanUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningBooleanUnsafe; import net.imglib2.img.basictypelongaccess.unsafe.owning.OwningShortUnsafe; import net.imglib2.type.NativeLongAccessType; import net.imglib2.type.NativeLongAccessTypeFactory; @@ -83,11 +83,11 @@ public static long numEntities( final long[] dimensions, final Fraction entities } @Override - public UnsafeImg< T, OwningNativeBooleanUnsafe > createNativeBooleanInstance( final long[] dimensions, final Fraction entitiesPerPixel ) + public UnsafeImg< T, OwningBooleanUnsafe > createNativeBooleanInstance( final long[] dimensions, final Fraction entitiesPerPixel ) { final long numEntities = numEntities( dimensions, entitiesPerPixel ); - return new UnsafeImg<>( new OwningNativeBooleanUnsafe( numEntities ), dimensions, entitiesPerPixel ); + return new UnsafeImg<>( new OwningBooleanUnsafe( numEntities ), dimensions, entitiesPerPixel ); } @Override diff --git a/src/test/java/net/imglib2/img/basictypeaccess/unsafe/BooleanUnsafeTest.java b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/BooleanUnsafeTest.java new file mode 100644 index 0000000..7b4c97f --- /dev/null +++ b/src/test/java/net/imglib2/img/basictypeaccess/unsafe/BooleanUnsafeTest.java @@ -0,0 +1,91 @@ +/*- + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ +package net.imglib2.img.basictypeaccess.unsafe; + +import static org.junit.Assert.assertEquals; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import net.imglib2.img.basictypelongaccess.unsafe.BooleanUnsafe; +import net.imglib2.img.basictypelongaccess.unsafe.UnsafeUtil; + +/** + * Tests basic {@link BooleanUnsafe} functionality + * + * @author Gabriel Selzer + */ +public class BooleanUnsafeTest +{ + + private BooleanUnsafe b; + + private long address; + + private final Boolean startingValue = false; + + @Before + public void setup() + { + // Allocate heap memory for testing + address = UnsafeUtil.UNSAFE.allocateMemory( 8 ); + + b = new BooleanUnsafe( address ); + b.setValue( 0, startingValue ); + } + + @After + public void tearDown() + { + // Free heap memory + UnsafeUtil.UNSAFE.freeMemory( b.getAddres() ); + } + + @Test + public void testBooleanUnsafeGetValue() + { + assertEquals( startingValue, b.getValue( 0 ) ); + } + + @Test + public void testBooleanUnsafeSetValue() + { + boolean newValue = true; + b.setValue( 0, newValue ); + assertEquals( newValue, b.getValue( 0 ) ); + } + + @Test + public void testBooleanUnsafeGetAddress() + { + assertEquals( address, b.getAddres() ); + } + +} From ce2870046f9e8da2f9c2ed6c35aec2dd32f8bfb7 Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Thu, 2 Feb 2023 13:05:10 -0600 Subject: [PATCH 14/15] Add class javadoc for Wrapped*Access classes --- .../img/basictypelongaccess/wrapped/WrappedByteLongAccess.java | 2 +- .../img/basictypelongaccess/wrapped/WrappedCharLongAccess.java | 2 +- .../basictypelongaccess/wrapped/WrappedDoubleLongAccess.java | 2 +- .../img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java | 2 +- .../img/basictypelongaccess/wrapped/WrappedIntLongAccess.java | 2 +- .../img/basictypelongaccess/wrapped/WrappedLongLongAccess.java | 2 +- .../img/basictypelongaccess/wrapped/WrappedShortLongAccess.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedByteLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedByteLongAccess.java index 6d6791a..01832d3 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedByteLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedByteLongAccess.java @@ -33,7 +33,7 @@ import net.imglib2.img.basictypelongaccess.ByteLongAccess; /** - * TODO + * A {@link ByteLongAccess} backed by a {@link ByteAccess}. * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedCharLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedCharLongAccess.java index c45d8b4..c2ef668 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedCharLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedCharLongAccess.java @@ -33,7 +33,7 @@ import net.imglib2.img.basictypelongaccess.CharLongAccess; /** - * TODO + * A {@link CharLongAccess} backed by a {@link CharAccess}. * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedDoubleLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedDoubleLongAccess.java index 12b479e..45d143d 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedDoubleLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedDoubleLongAccess.java @@ -33,7 +33,7 @@ import net.imglib2.img.basictypelongaccess.DoubleLongAccess; /** - * TODO + * A {@link DoubleLongAccess} backed by a {@link DoubleAccess}. * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java index 16b2e12..a399ca6 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedFloatLongAccess.java @@ -33,7 +33,7 @@ import net.imglib2.img.basictypelongaccess.FloatLongAccess; /** - * TODO + * A {@link FloatLongAccess} backed by a {@link FloatAccess}. * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedIntLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedIntLongAccess.java index 688a44d..d2fc7cf 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedIntLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedIntLongAccess.java @@ -33,7 +33,7 @@ import net.imglib2.img.basictypelongaccess.IntLongAccess; /** - * TODO + * An {@link IntLongAccess} backed by an {@link IntAccess}. * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedLongLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedLongLongAccess.java index 9aa5ece..b65a6d7 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedLongLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedLongLongAccess.java @@ -33,7 +33,7 @@ import net.imglib2.img.basictypelongaccess.LongLongAccess; /** - * TODO + * A {@link LongLongAccess} backed by a {@link LongAccess}. * * @author Stephan Preibisch * @author Stephan Saalfeld diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedShortLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedShortLongAccess.java index 5d51bb6..93772fe 100644 --- a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedShortLongAccess.java +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedShortLongAccess.java @@ -33,7 +33,7 @@ import net.imglib2.img.basictypelongaccess.ShortLongAccess; /** - * TODO + * A {@link ShortLongAccess} backed by a {@link ShortAccess}. * * @author Stephan Preibisch * @author Stephan Saalfeld From 65fc964b68bebafd9bd853c54236626376aa7cfd Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Thu, 2 Feb 2023 13:08:18 -0600 Subject: [PATCH 15/15] Add WrappedBooleanLongAccess class Like some others, it is not used, but for consistency it should exist. --- .../wrapped/WrappedBooleanLongAccess.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedBooleanLongAccess.java diff --git a/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedBooleanLongAccess.java b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedBooleanLongAccess.java new file mode 100644 index 0000000..8b5dd46 --- /dev/null +++ b/src/main/java/net/imglib2/img/basictypelongaccess/wrapped/WrappedBooleanLongAccess.java @@ -0,0 +1,74 @@ +/* + * #%L + * ImgLib2 data structures using Unsafe. + * %% + * Copyright (C) 2017 - 2023 Howard Hughes Medical Institute. + * %% + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * #L% + */ + +package net.imglib2.img.basictypelongaccess.wrapped; + +import net.imglib2.img.basictypeaccess.BooleanAccess; +import net.imglib2.img.basictypelongaccess.BooleanLongAccess; + +/** + * A {@link BooleanLongAccess} backed by a {@link BooleanAccess}. + * + * @author Curtis Rueden + */ +public class WrappedBooleanLongAccess< A extends BooleanAccess > implements BooleanLongAccess +{ + + private final A access; + + public WrappedBooleanLongAccess( final A access ) + { + super(); + this.access = access; + } + + @Override + public boolean getValue( final long index ) + { + return getValue( ( int ) index ); + } + + @Override + public void setValue( final long index, final boolean value ) + { + setValue( ( int ) index, value ); + } + + @Override + public boolean getValue( final int index ) + { + return access.getValue( index ); + } + + @Override + public void setValue( final int index, final boolean value ) + { + access.setValue( index, value ); + } +}