@Override public ClampingNLinearInterpolatorVolatileARGB< T > copy() { return new ClampingNLinearInterpolatorVolatileARGB<>( this ); }
final private void graycodeBckRecursive( final int dimension ) { if ( dimension == 0 ) { target.bck( 0 ); code -= 1; accumulate(); } else { graycodeFwdRecursive( dimension - 1 ); target.bck( dimension ); code -= 1 << dimension; accumulate(); graycodeBckRecursive( dimension - 1 ); } }
@Override public ClampingNLinearInterpolatorVolatileARGB< T > copyRealRandomAccess() { return copy(); }
public T get() fillWeights(); graycodeFwdRecursive( n - 1 ); target.bck( n - 1 );
public T get() fillWeights(); graycodeFwdRecursive( n - 1 ); target.bck( n - 1 );
final private void graycodeBckRecursive( final int dimension ) { if ( dimension == 0 ) { target.bck( 0 ); code -= 1; accumulate(); } else { graycodeFwdRecursive( dimension - 1 ); target.bck( dimension ); code -= 1 << dimension; accumulate(); graycodeBckRecursive( dimension - 1 ); } }
@Override public ClampingNLinearInterpolatorVolatileARGB< T > copy() { return new ClampingNLinearInterpolatorVolatileARGB<>( this ); }
@Override public ClampingNLinearInterpolatorVolatileARGB< T > copyRealRandomAccess() { return copy(); }
final private void graycodeFwdRecursive( final int dimension ) { if ( dimension == 0 ) { target.fwd( 0 ); code += 1; accumulate(); } else { graycodeFwdRecursive( dimension - 1 ); target.fwd( dimension ); code += 1 << dimension; accumulate(); graycodeBckRecursive( dimension - 1 ); } }
@SuppressWarnings( { "unchecked", "rawtypes" } ) @Override public RealRandomAccess< T > create( final RandomAccessible< T > randomAccessible ) { final T type = randomAccessible.randomAccess().get(); if ( type instanceof RealType ) { if ( type instanceof Volatile ) return new ClampingNLinearInterpolatorVolatileRealType( randomAccessible ); else return new ClampingNLinearInterpolatorRealType( randomAccessible ); } else if ( ARGBType.class.isInstance( type ) ) { return ( RealRandomAccess ) new NLinearInterpolatorARGB( ( RandomAccessible ) randomAccessible ); } else if ( VolatileARGBType.class.isInstance( type ) ) { return ( RealRandomAccess ) new ClampingNLinearInterpolatorVolatileARGB< VolatileARGBType >( ( RandomAccessible ) randomAccessible ); } else // fall back to (non-clamping) NLinearInterpolator return new NLinearInterpolator<>( randomAccessible ); }
final private void graycodeFwdRecursive( final int dimension ) { if ( dimension == 0 ) { target.fwd( 0 ); code += 1; accumulate(); } else { graycodeFwdRecursive( dimension - 1 ); target.fwd( dimension ); code += 1 << dimension; accumulate(); graycodeBckRecursive( dimension - 1 ); } }
@SuppressWarnings( { "unchecked", "rawtypes" } ) @Override public RealRandomAccess< T > create( final RandomAccessible< T > randomAccessible ) { final T type = randomAccessible.randomAccess().get(); if ( type instanceof RealType ) { if ( type instanceof Volatile ) return new ClampingNLinearInterpolatorVolatileRealType( randomAccessible ); else return new ClampingNLinearInterpolatorRealType( randomAccessible ); } else if ( ARGBType.class.isInstance( type ) ) { return ( RealRandomAccess ) new NLinearInterpolatorARGB( ( RandomAccessible ) randomAccessible ); } else if ( VolatileARGBType.class.isInstance( type ) ) { return ( RealRandomAccess ) new ClampingNLinearInterpolatorVolatileARGB< VolatileARGBType >( ( RandomAccessible ) randomAccessible ); } else // fall back to (non-clamping) NLinearInterpolator return new NLinearInterpolator<>( randomAccessible ); }