public static < T extends NativeType< T >, A extends DoubleAccess > NativeTypeFactory< T, A > DOUBLE( final Function< NativeImg< T, ? extends A >, T > createLinkedType ) { return new NativeTypeFactory<>( PrimitiveType.DOUBLE, createLinkedType ); } }
SingleCellArrayImg( final int[] cellDims, final long[] cellMin, final A cellData, final Dirty dirtyFlag, final T type ) { this( cellDims, cellMin, cellData, dirtyFlag ); @SuppressWarnings( "unchecked" ) final NativeTypeFactory< T, ? super A > info = ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory(); setLinkedType( info.createLinkedType( this ) ); }
public static < A extends ArrayDataAccess< A > > A get( final NativeTypeFactory< ?, ? super A > typeFactory, final Set< AccessFlags > flags ) { return get( typeFactory.getPrimitiveType(), flags ); }
@SuppressWarnings( "unchecked" ) private T createType( final A access ) { T t = ( ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory() ).createLinkedType( new NoImg<>( access ) ); t.updateContainer( null ); return t; }
public static < A extends ArrayDataAccess< A > > A get( final NativeTypeFactory< ?, ? super A > typeFactory, final Set< AccessFlags > flags ) { return get( typeFactory.getPrimitiveType(), flags ); }
public LazyCellImg( final CellGrid grid, final T type, final Get< Cell< A > > get ) { super( grid, new LazyCells<>( grid.getGridDimensions(), get ), type.getEntitiesPerPixel() ); @SuppressWarnings( "unchecked" ) final NativeTypeFactory< T, ? super A > typeFactory = ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory(); setLinkedType( typeFactory.createLinkedType( this ) ); }
public static < T extends NativeType< T >, A > AccessIo< A > get( final T type, final Set< AccessFlags > flags ) { return get( type.getNativeTypeFactory().getPrimitiveType(), flags ); }
public static < T extends NativeType< T >, A extends LongAccess > NativeTypeFactory< T, A > LONG( final Function< NativeImg< T, ? extends A >, T > createLinkedType ) { return new NativeTypeFactory<>( PrimitiveType.LONG, createLinkedType ); }
public VolatileCachedCellImg( final CellGrid grid, final T type, final CacheHints cacheHints, final Get< Cell< A > > get ) { super( grid, new VolatileCachedCells<>( grid.getGridDimensions(), get, cacheHints ), type.getEntitiesPerPixel() ); @SuppressWarnings( "unchecked" ) final NativeTypeFactory< T, ? super A > typeFactory = ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory(); setLinkedType( typeFactory.createLinkedType( this ) ); }
public static < A extends VolatileArrayDataAccess< A > > CreateInvalidVolatileCell< A > get( final CellGrid grid, final Fraction entitiesPerPixel, final PrimitiveType primitiveType, final boolean dirty ) throws IllegalArgumentException { if ( primitiveType == PrimitiveType.UNDEFINED ) throw new IllegalArgumentException( "Cannot instantiate " + CreateInvalidVolatileCell.class.getSimpleName() + " for unrecognized primitive type" ); return new CreateInvalidVolatileCell< A >( grid, entitiesPerPixel, EmptyArrayCreator.get( primitiveType, dirty ) ); } }
public static < T extends NativeType< T >, A extends FloatAccess > NativeTypeFactory< T, A > FLOAT( final Function< NativeImg< T, ? extends A >, T > createLinkedType ) { return new NativeTypeFactory<>( PrimitiveType.FLOAT, createLinkedType ); }
public LazyCellImg( final CellGrid grid, final T type, final Get< Cell< A > > get ) { super( grid, new LazyCells<>( grid.getGridDimensions(), get ), type.getEntitiesPerPixel() ); @SuppressWarnings( "unchecked" ) final NativeTypeFactory< T, ? super A > typeFactory = ( NativeTypeFactory< T, ? super A > ) type.getNativeTypeFactory(); setLinkedType( typeFactory.createLinkedType( this ) ); }
public static < T extends NativeType< T >, A > A get( final T type, final Set< AccessFlags > flags ) { return get( type.getNativeTypeFactory().getPrimitiveType(), flags ); }
public static < T extends NativeType< T >, A extends BooleanAccess > NativeTypeFactory< T, A > BOOLEAN( final Function< NativeImg< T, ? extends A >, T > createLinkedType ) { return new NativeTypeFactory<>( PrimitiveType.BOOLEAN, createLinkedType ); }
private < A > NtreeImg< T, ? > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); if ( entitiesPerPixel.getNumerator() != entitiesPerPixel.getDenominator() ) throw new RuntimeException( "not implemented" ); final long[] pos = new long[ dimensions.length ]; final NtreeImg< T, ? extends A > img = new NtreeImg<>( createNtreeAccess( typeFactory, dimensions ).createInstance( pos ), // calling createInstance(pos) is necessary here, because // otherwise javac will not infer the NtreeAccess type dimensions, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
public static < T extends NativeType< T >, A > A get( final T type, final Set< AccessFlags > flags ) { return get( type.getNativeTypeFactory().getPrimitiveType(), flags ); }
public static < T extends NativeType< T >, A extends ByteAccess > NativeTypeFactory< T, A > BYTE( final Function< NativeImg< T, ? extends A >, T > createLinkedType ) { return new NativeTypeFactory<>( PrimitiveType.BYTE, createLinkedType ); }
private < A > NtreeImg< T, ? > create( final long[] dimensions, final T type, final NativeTypeFactory< T, A > typeFactory ) { final Fraction entitiesPerPixel = type.getEntitiesPerPixel(); if ( entitiesPerPixel.getNumerator() != entitiesPerPixel.getDenominator() ) throw new RuntimeException( "not implemented" ); final long[] pos = new long[ dimensions.length ]; final NtreeImg< T, ? extends A > img = new NtreeImg<>( createNtreeAccess( typeFactory, dimensions ).createInstance( pos ), // calling createInstance(pos) is necessary here, because // otherwise javac will not infer the NtreeAccess type dimensions, entitiesPerPixel ); img.setLinkedType( typeFactory.createLinkedType( img ) ); return img; }
public static < A extends ArrayDataAccess< A > > EmptyCellCacheLoader< A > get( final CellGrid grid, final Fraction entitiesPerPixel, final PrimitiveType primitiveType, final Set< AccessFlags > flags ) { final A creator = ArrayDataAccessFactory.get( primitiveType, flags ); return creator == null ? null : new EmptyCellCacheLoader<>( grid, entitiesPerPixel, creator ); } }
public static < T extends NativeType< T >, A extends ShortAccess > NativeTypeFactory< T, A > SHORT( final Function< NativeImg< T, ? extends A >, T > createLinkedType ) { return new NativeTypeFactory<>( PrimitiveType.SHORT, createLinkedType ); }