@Override public void localize( final long[] position ) { getCell().indexToGlobalPosition( index, position ); }
public LazyCellImg( final CellGrid grid, final Fraction entitiesPerPixel, final Get< Cell< A > > get ) { super( grid, new LazyCells<>( grid.getGridDimensions(), get ), entitiesPerPixel ); }
private < T extends NativeType< T > > void testDefaultCellSize( final T type ) { final int defaultCellSize = 43; final int[] expectedCellDims = { 43, 43, 43, 43 }; final CellImgFactory< T > factory = new CellImgFactory<>( type, defaultCellSize ); final long[] dimension = { 100, 80, 4, 3 }; final CellImg< T, ? > img = factory.create( dimension ); final int[] cellDims = new int[ dimension.length ]; img.getCellGrid().cellDimensions( cellDims ); assertArrayEquals( expectedCellDims, cellDims ); }
private CellGrid createCellGrid(final long[] dimensions, final Fraction entitiesPerPixel) { CellImgFactory.verifyDimensions(dimensions); final int n = dimensions.length; final int[] defaultDims = new int[dimensions.length]; for (int d = 0; d < defaultDims.length; d++) { defaultDims[d] = dimensions[d] < defaultCellDimensions[d] ? // (int) dimensions[d] : defaultCellDimensions[d]; } final int[] cellDimensions = CellImgFactory.getCellDimensions( defaultDims, n, entitiesPerPixel); return new CellGrid(dimensions, cellDimensions); }
@Override public CellLocalizingCursor< T, C > copy() { return new CellLocalizingCursor<>( this ); }
@Override public CellRandomAccess< T, C > randomAccess() { return new CellRandomAccess<>( this ); }
@Override public CellIterationOrder iterationOrder() { return new CellIterationOrder( this ); }
@Override public CellCursor< T, C > copyCursor() { return copy(); }
public AbstractCellImg( final CellGrid grid, final I imgOfCells, final Fraction entitiesPerPixel ) { super( grid.getImgDimensions(), entitiesPerPixel ); this.grid = grid; this.cells = imgOfCells; }
@Override protected T get( final long index ) { return get.get( index ); }
@Override public CellCursor< T, C > cursor() { return new CellCursor<>( this ); }
@Override public long getLongPosition( final int dim ) { return getCell().indexToGlobalPosition( index, dim ); }
public LazyCellImg( final CellGrid grid, final Fraction entitiesPerPixel, final Get< Cell< A > > get ) { super( grid, new LazyCells<>( grid.getGridDimensions(), get ), entitiesPerPixel ); }
@Override public CellLocalizingCursor< T, C > localizingCursor() { return new CellLocalizingCursor<>( this ); }
@Override public CellRandomAccess< T, C > copy() { return new CellRandomAccess<>( this ); }
@Override public CellIterationOrder iterationOrder() { return new CellIterationOrder( this ); }
@Override public long getLongPosition( final int dim ) { return getCell().indexToGlobalPosition( index, dim ); }
@Override public void localize( final long[] position ) { getCell().indexToGlobalPosition( index, position ); }