@Override public void map() { for (int d = 2; d < position.length; ++d) min[d] = max[d] = position[d]; min[0] = target.min(0); min[1] = target.min(1); max[0] = target.max(0); max[1] = target.max(1); final FinalInterval sourceInterval = new FinalInterval(min, max); final long cr = -target.dimension(0); final RandomAccess<B> targetRandomAccess = target.randomAccess(target); final RandomAccess<A> sourceRandomAccess = source.randomAccess(sourceInterval); for (sourceRandomAccess.setPosition(min), targetRandomAccess.setPosition(min[0], 0), targetRandomAccess.setPosition(min[1], 1); targetRandomAccess.getLongPosition(1) <= max[1]; sourceRandomAccess.move(cr, 0), targetRandomAccess.move(cr, 0), sourceRandomAccess.fwd(1), targetRandomAccess.fwd(1)) { for (; targetRandomAccess.getLongPosition(0) <= max[0]; sourceRandomAccess.fwd(0), targetRandomAccess.fwd(0)) converter.convert(sourceRandomAccess.get(), targetRandomAccess.get()); } }
@Override public long getLongPosition(final int d) { return source.getLongPosition(d); }
@Override public long getLongPosition(final int d) { return randomAccess.getLongPosition(d); }