1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
/* resample.h */
#ifndef RESAMPLE_H
#define RESAMPLE_H
#include "grid.h"
/*
* A resampler struct carries the information needed to resample a 3-D
* grid from one projection and VCS to a new projection and VCS.
* We perform vertical resampling first, then horizontal resampling.
*/
struct resampler {
struct projection *inproj; /* Input projection */
struct vcs *invcs; /* Input VCS */
struct projection *outproj; /* Output projection */
struct vcs *outvcs; /* Output VCS */
/*
* These values indicate the size of the dynamic arrays below:
*/
int inR, inC, inL; /* size of input grid */
int outR, outC, outL; /* size of output grid */
/*
* For a given level in the output grid, Level indicates which
* data values to sample in the input grid. The Coef values are
* the weights to use in the resampling. The arrays are also
* indexed by (row,col) to allow sigma coordinates (relative to
* topography).
*/
int DoVertical; /* Is vertical resampling needed? */
float *SampLev; /* SampLev[outL][inR][inC] */
/*
* For a given (row,col) in the output grid, RectRow and RectCol
* indicates which data values to sample in the input grid. The
* Coef_s and Coef_t values are the weights to use in the sampling.
*/
int DoHorizontal; /* Is horizontal resampling needed? */
float *SampRow; /* SampRow[outR][outC] */
float *SampCol; /* SampCol[outR][outC] */
int Guard; /* how many boundary rows & cols to discard */
};
extern struct resampler *get_resampler( struct projection *inproj,
struct vcs *invcs,
struct projection *outproj,
struct vcs *outvcs,
int outnl );
extern void free_resamplers( void );
extern void resample_vertical( struct resampler *r,
float *indata, float *outdata );
extern void resample_horizontal( struct resampler *r,
float *indata, float *outdata );
#endif
|