1
/* @(#)r.proj.h v1.2 - 27 Jun 1995 -emes- */
6
#include <grass/gprojects.h>
9
#define BDIM (1<<(L2BDIM))
10
#define L2BSIZE (2*(L2BDIM))
11
#define BSIZE (1<<(L2BSIZE))
12
#define HI(i) ((i)>>(L2BDIM))
13
#define LO(i) ((i)&((BDIM)-1))
15
typedef FCELL block[BDIM][BDIM];
27
typedef void (*func) (struct cache *, void *, int, double *, double *,
32
func method; /* routine to interpolate new value */
33
char *name; /* method name */
34
char *text; /* menu display - full description */
37
extern void bordwalk(struct Cell_head *, struct Cell_head *, struct pj_info *,
39
extern struct cache *readcell(int, const char *);
40
extern block *get_block(struct cache *, int);
42
/* declare resampling methods */
44
extern void p_bilinear(struct cache *, void *, int, double *, double *,
47
extern void p_cubic(struct cache *, void *, int, double *, double *,
50
extern void p_nearest(struct cache *, void *, int, double *, double *,
55
#define BKIDX(c,y,x) ((y) * (c)->stride + (x))
56
#define BKPTR(c,y,x) ((c)->grid[BKIDX((c),(y),(x))])
57
#define BLOCK(c,y,x) (BKPTR((c),(y),(x)) ? BKPTR((c),(y),(x)) : get_block((c),BKIDX((c),(y),(x))))
58
#define CPTR(c,y,x) (&(*BLOCK((c),HI((y)),HI((x))))[LO((y))][LO((x))])
62
static inline int BKIDX(const struct cache *c, int y, int x)
64
return y * c->stride + x;
67
static inline block *BKPTR(const struct cache *c, int y, int x)
69
return c->grid[BKIDX(c, y, x)];
72
static inline block *BLOCK(struct cache *c, int y, int x)
74
return BKPTR(c, y, x) ? BKPTR(c, y, x) : get_block(c, BKIDX(c, y, x));
77
static inline FCELL *CPTR(struct cache *c, int y, int x)
79
return &(*BLOCK(c, HI(y), HI(x)))[LO(y)][LO(x)];