@Override public ClampingNLinearInterpolatorRealType< T > copy() { return new ClampingNLinearInterpolatorRealType<>( this ); }
@Override public ClampingNLinearInterpolatorRealType< T > copy() { return new ClampingNLinearInterpolatorRealType<>( this ); }
@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 ); }
@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 ); }