@openhps/core
Version:
Open Hybrid Positioning System - Core component
30 lines (29 loc) • 978 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DiscreteInterpolant = void 0;
var _Interpolant = require("../Interpolant.js");
/**
* Interpolant that evaluates to the sample value at the position preceding
* the parameter.
*
* @augments Interpolant
*/
class DiscreteInterpolant extends _Interpolant.Interpolant {
/**
* Constructs a new discrete interpolant.
*
* @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.
* @param {TypedArray} sampleValues - The sample values.
* @param {number} sampleSize - The sample size
* @param {TypedArray} [resultBuffer] - The result buffer.
*/
constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {
super(parameterPositions, sampleValues, sampleSize, resultBuffer);
}
interpolate_(i1 /*, t0, t, t1 */) {
return this.copySampleValue_(i1 - 1);
}
}
exports.DiscreteInterpolant = DiscreteInterpolant;