DiscreteInterpolant.js 625 B

123456789101112131415161718192021222324252627282930
  1. import { Interpolant } from '../Interpolant.js';
  2. /**
  3. *
  4. * Interpolant that evaluates to the sample value at the position preceeding
  5. * the parameter.
  6. *
  7. * @author tschw
  8. */
  9. function DiscreteInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) {
  10. Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer );
  11. }
  12. DiscreteInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), {
  13. constructor: DiscreteInterpolant,
  14. interpolate_: function ( i1 /*, t0, t, t1 */ ) {
  15. return this.copySampleValue_( i1 - 1 );
  16. }
  17. } );
  18. export { DiscreteInterpolant };
粤ICP备19079148号