~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to raster/r.proj.seg/r.proj.h

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* @(#)r.proj.h v1.2 - 27 Jun 1995      -emes- */
2
 
 
3
 
#ifndef R_PROJ_H
4
 
#define R_PROJ_H
5
 
 
6
 
#include <grass/gprojects.h>
7
 
 
8
 
#define L2BDIM 6
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))
14
 
 
15
 
typedef FCELL block[BDIM][BDIM];
16
 
 
17
 
struct cache
18
 
{
19
 
    int fd;
20
 
    int stride;
21
 
    int nblocks;
22
 
    block **grid;
23
 
    block *blocks;
24
 
    int *refs;
25
 
};
26
 
 
27
 
typedef void (*func) (struct cache *, void *, int, double *, double *,
28
 
                      struct Cell_head *);
29
 
 
30
 
struct menu
31
 
{
32
 
    func method;                /* routine to interpolate new value      */
33
 
    char *name;                 /* method name                           */
34
 
    char *text;                 /* menu display - full description       */
35
 
};
36
 
 
37
 
extern void bordwalk(struct Cell_head *, struct Cell_head *, struct pj_info *,
38
 
                     struct pj_info *);
39
 
extern struct cache *readcell(int, const char *);
40
 
extern block *get_block(struct cache *, int);
41
 
 
42
 
/* declare resampling methods */
43
 
/* bilinear.c */
44
 
extern void p_bilinear(struct cache *, void *, int, double *, double *,
45
 
                       struct Cell_head *);
46
 
/* cubic.c */
47
 
extern void p_cubic(struct cache *, void *, int, double *, double *,
48
 
                    struct Cell_head *);
49
 
/* nearest.c */
50
 
extern void p_nearest(struct cache *, void *, int, double *, double *,
51
 
                      struct Cell_head *);
52
 
 
53
 
#if 1
54
 
 
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))])
59
 
 
60
 
#else
61
 
 
62
 
static inline int BKIDX(const struct cache *c, int y, int x)
63
 
{
64
 
    return y * c->stride + x;
65
 
}
66
 
 
67
 
static inline block *BKPTR(const struct cache *c, int y, int x)
68
 
{
69
 
    return c->grid[BKIDX(c, y, x)];
70
 
}
71
 
 
72
 
static inline block *BLOCK(struct cache *c, int y, int x)
73
 
{
74
 
    return BKPTR(c, y, x) ? BKPTR(c, y, x) : get_block(c, BKIDX(c, y, x));
75
 
}
76
 
 
77
 
static inline FCELL *CPTR(struct cache *c, int y, int x)
78
 
{
79
 
    return &(*BLOCK(c, HI(y), HI(x)))[LO(y)][LO(x)];
80
 
}
81
 
 
82
 
#endif
83
 
 
84
 
#endif