| 15 |
|
#define NI2DSMF 0.42f /* minimal smoothing factor */ |
| 16 |
|
|
| 17 |
|
#define NI2DIR (2*4) /* # interpolation directions */ |
| 18 |
+ |
#define NI2DIM 16 /* size of black flag array */ |
| 19 |
|
|
| 20 |
|
/* Data structure for interpolant */ |
| 21 |
|
typedef struct { |
| 22 |
|
int ns; /* number of sample positions */ |
| 23 |
|
float dmin; /* minimum diameter (default=1) */ |
| 24 |
|
float smf; /* smoothing factor (def=NI2DSMF) */ |
| 25 |
< |
unsigned short (*da)[NI2DIR]; /* anisotropic distances (private) */ |
| 25 |
> |
float smin[2]; /* sample minima */ |
| 26 |
> |
float smul[2]; /* NI2DIM/(smax-smin) */ |
| 27 |
> |
float grid2; /* twice grid diameter squared */ |
| 28 |
> |
struct interp2_samp { |
| 29 |
> |
unsigned short dia[NI2DIR]; |
| 30 |
> |
unsigned short blkflg[NI2DIM]; |
| 31 |
> |
} *da; /* direction array (private) */ |
| 32 |
|
float spt[1][2]; /* sample positions (extends struct) */ |
| 33 |
|
} INTERP2; |
| 34 |
|
|
| 55 |
|
|
| 56 |
|
/* (Re)compute anisotropic basis function interpolant (normally automatic) */ |
| 57 |
|
extern int interp2_analyze(INTERP2 *ip); |
| 58 |
+ |
|
| 59 |
+ |
/* Compute unnormalized weight for a position relative to a sample */ |
| 60 |
+ |
double interp2_wti(INTERP2 *ip, const int i, double x, double y); |
| 61 |
|
|
| 62 |
|
/*************************************************************** |
| 63 |
|
* Typical use is to allocate an INTERP2 struct and assign the |