Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qinterp1.h
1
8
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
23
41
42
46 typedef struct {
48 float (*method)( const float x,
49 const float * const tx,
50 const float * const ty,
51 const size_t tableSize );
52 const float *xData;
53 const float *yData;
54 size_t dataSize;
56 } qInterp1_t;
57
66 int qInterp1_Setup( qInterp1_t * const i,
67 const float * const xTable,
68 const float * const yTable,
69 const size_t sizeTable );
70
79 int qInterp1_SetData( qInterp1_t * const i,
80 const float * const xTable,
81 const float * const yTable,
82 const size_t sizeTable );
83
90 int qInterp1_SetMethod( qInterp1_t * const i,
91 const qInterp1Method_t m );
92
93
102 float qInterp1_Get( qInterp1_t * const i,
103 const float x );
104
106
107#ifdef __cplusplus
108}
109#endif
110
111#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:46