Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qinterp1.h
1
9#ifndef QINTERP1_H
10#define QINTERP1_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16 #include <stdlib.h>
17 #include <stdint.h>
18
39
40
44 typedef struct {
46 float (*method)( const float x,
47 const float * const tx,
48 const float * const ty,
49 const size_t tableSize );
50 const float *xData;
51 const float *yData;
52 size_t dataSize;
54 } qInterp1_t;
55
64 int qInterp1_Setup( qInterp1_t * const i,
65 const float * const xTable,
66 const float * const yTable,
67 const size_t sizeTable );
68
77 int qInterp1_SetData( qInterp1_t * const i,
78 const float * const xTable,
79 const float * const yTable,
80 const size_t sizeTable );
81
88 int qInterp1_SetMethod( qInterp1_t * const i,
89 const qInterp1Method_t m );
90
91
100 float qInterp1_Get( qInterp1_t * const i,
101 const float x );
102
105#ifdef __cplusplus
106}
107#endif
108
109#endif
float qInterp1_Get(qInterp1_t *const i, const float x)
Interpolate input point x to determine the value of y at the points xi using the current method....
Definition qinterp1.c:122
int qInterp1_SetMethod(qInterp1_t *const i, const qInterp1Method_t m)
Specify the interpolation method to use.
Definition qinterp1.c:98
int qInterp1_Setup(qInterp1_t *const i, const float *const xTable, const float *const yTable, const size_t sizeTable)
Setup and initialize the 1D interpolation instance.
Definition qinterp1.c:72
int qInterp1_SetData(qInterp1_t *const i, const float *const xTable, const float *const yTable, const size_t sizeTable)
Set the data table for the 1D interpolation instance.
Definition qinterp1.c:90
qInterp1Method_t
An enum with all the available interpolation methods.
Definition qinterp1.h:27
@ QINTERP1_NEAREST
Definition qinterp1.h:30
@ QINTERP1_LINEAR
Definition qinterp1.h:31
@ QINTERP1_SPLINE
Definition qinterp1.h:35
@ QINTERP1_CUBIC
Definition qinterp1.h:33
@ QINTERP1_NEXT
Definition qinterp1.h:28
@ QINTERP1_CONSTRAINED_SPLINE
Definition qinterp1.h:36
@ QINTERP1_HERMITE
Definition qinterp1.h:34
@ QINTERP1_SINE
Definition qinterp1.h:32
@ QINTERP1_PREVIOUS
Definition qinterp1.h:29
A 1D interpolation object.
Definition qinterp1.h:44