@Override public LongArray createArray( final int numEntities ) { return new LongArray( numEntities ); } }
@Override public void mutate(final ArrayImg<LongType, LongArray> arg) { final long[] data = arg.update(null).getCurrentStorageArray(); for (int i = 0; i < data.length; i++) { data[i] += value; } }
return dirty ? ( volatil ? ( RandomAccessibleCacheLoader< T, A, CA > ) new RandomAccessibleCacheLoader<>( grid, source, type, new LongArray( 0 ), a -> new DirtyVolatileLongArray( a.getCurrentStorageArray(), true ) ) : ( RandomAccessibleCacheLoader< T, A, CA > ) new RandomAccessibleCacheLoader<>( grid, source, type, new LongArray( 0 ), a -> new DirtyLongArray( a.getCurrentStorageArray() ) ) ) : ( volatil ? ( RandomAccessibleCacheLoader< T, A, CA > ) new RandomAccessibleCacheLoader<>( grid, source, type, new LongArray( 0 ), a -> new VolatileLongArray( a.getCurrentStorageArray(), true ) ) : ( RandomAccessibleCacheLoader< T, A, CA > ) new RandomAccessibleCacheLoader<>( grid, source, type, new LongArray( 0 ), a -> a ) ); case SHORT: return dirty
@Override public void convertBytes(final LongArray data, final byte[] bytes, final int planesRead) { final ImageMetadata iMeta = reader().getMetadata().get(0); if (isCompatible()) { final int bpp = getBitsPerElement() / 8; final int offset = planesRead * (bytes.length / bpp); final ByteBuffer bb = ByteBuffer.wrap(bytes); bb.order(iMeta.isLittleEndian() ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); bb.asLongBuffer().get(data.getCurrentStorageArray(), offset, bytes.length / bpp); } else { final int pixelType = iMeta.getPixelType(); final int bpp = FormatTools.getBytesPerPixel(pixelType); final int offset = planesRead * (bytes.length / bpp); for (int index = 0; index < bytes.length / bpp; index++) { final long value = (long) utils().decodeWord(bytes, index * bpp, pixelType, iMeta.isLittleEndian()); data.setValue(offset + index, value); } } }
@Override public void convertBytes(final LongArray data, final byte[] bytes, final int planesRead) { final ImageMetadata iMeta = reader().getMetadata().get(0); if (isCompatible()) { final int bpp = getBitsPerElement() / 8; final int offset = planesRead * (bytes.length / bpp); final ByteBuffer bb = ByteBuffer.wrap(bytes); bb.order(iMeta.isLittleEndian() ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); bb.asLongBuffer().get(data.getCurrentStorageArray(), offset, bytes.length / bpp); } else { final int pixelType = iMeta.getPixelType(); final int bpp = FormatTools.getBytesPerPixel(pixelType); final int offset = planesRead * (bytes.length / bpp); for (int index = 0; index < bytes.length / bpp; index++) { final long value = (long) utils().decodeWord(bytes, index * bpp, pixelType, iMeta.isLittleEndian()); data.setValue(offset + index, value); } } }
@Override public LongArray createArray( final int numEntities ) { return new LongArray( numEntities ); } }
@Override public void mutate(final ArrayImg<LongType, LongArray> arg) { final long[] data = arg.update(null).getCurrentStorageArray(); for (int i = 0; i < data.length; i++) { data[i] *= value; } }
@Override public LongArray emptyArray(final int entities) { return new LongArray(entities); }
@Override public void mutate(final ArrayImg<LongType, LongArray> arg) { final long[] data = arg.update(null).getCurrentStorageArray(); for (int i = 0; i < data.length; i++) { data[i] -= value; } }
@Override public LongArray emptyArray(final int entities) { return new LongArray(entities); }
@Override public void mutate(final ArrayImg<UnsignedLongType, LongArray> arg) { final long[] data = arg.update(null).getCurrentStorageArray(); for (int i = 0; i < data.length; i++) { data[i] /= value; } }
@Override public NativeImg< T, LongArray > createLongInstance( long[] dimensions, final int entitiesPerPixel ) { if ( dimensions.length > 5 ) throw new RuntimeException( "Unsupported dimensionality: " + dimensions.length ); return new ImagePlusImg< T, LongArray >( new LongArray( 1 ), dimensions, entitiesPerPixel ); }
@Override public void mutate(final ArrayImg<UnsignedLongType, LongArray> arg) { final long[] data = arg.update(null).getCurrentStorageArray(); for (int i = 0; i < data.length; i++) { data[i] += value; } }
public GenericLongType( final long value ) { img = null; dataAccess = new LongArray( 1 ); setLong( value ); }
@Override public void mutate(final ArrayImg<UnsignedLongType, LongArray> arg) { final long[] data = arg.update(null).getCurrentStorageArray(); for (int i = 0; i < data.length; i++) { data[i] -= value; } }
public UnsignedLongType( final BigInteger value ) { super( ( NativeImg< ?, ? extends LongAccess > ) null ); dataAccess = new LongArray( 1 ); set( value.longValue() ); }
@Override public void mutate(final ArrayImg<LongType, LongArray> arg) { final long[] data = arg.update(null).getCurrentStorageArray(); for (int i = 0; i < data.length; i++) { data[i] /= value; } }
public Unsigned128BitType( final long lower, final long upper ) { this( ( NativeImg< ?, ? extends LongAccess > ) null ); dataAccess = new LongArray( 2 ); set( lower, upper ); }
@Override public void mutate(final ArrayImg<UnsignedLongType, LongArray> arg) { final long[] data = arg.update(null).getCurrentStorageArray(); for (int i = 0; i < data.length; i++) { data[i] *= value; } }
public Unsigned2BitType( final long value ) { this( ( NativeImg< ?, ? extends LongAccess > ) null ); dataAccess = new LongArray( 1 ); set( value ); }