GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
Main Page
Related Pages
+
Data Structures
Data Structures
Class Hierarchy
+
Data Fields
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
+
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
w
y
z
+
Enumerations
a
c
d
e
h
l
m
n
o
p
r
s
t
v
y
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
▼
GRASS GIS 7 Programmer's Manual
Libraries
Core libraries
►
Further libraries
File structure of GRASS Location
►
Compiling and Installing GRASS Modules
Multiple-Architecture Conventions
►
Vector modules and their parameters/flags
►
GRASS Array Statistics Library
btree2 library
►
GRASS Cairo Display Driver
►
GRASS testing normality & exponentiality Library
►
GRASS Cluster analysis statistics Library
►
GRASS DataBase Management Interface
►
GRASS Display Library
►
CCMATH mathematics library source code
►
GRASS GIS General Library (aka GIS Library)
►
GRASS Numerical math interface
►
GRASS Partial differential equations Library (GPDE)
►
GRASS Imagery Library
►
GRASS Data Elements Manage Library
►
GRASS Nviz Library
►
GRASS GIS OGSF Library
GRASS GIS PNG Display Driver Library
►
GRASS and the PROJ projection library
GRASS Postscript Display Driver Library
►
GRASS Raster Library
►
GRASS 3D Raster Volume Library
GRASS Row Input/Output Library
GRASS Library for interpolation with regularized splines with tension
►
GRASS Segment Library
►
GRASS Directed Graph Library
►
GRASS Vector Library
Todo List
Deprecated List
Bug List
►
Data Structures
▼
Files
►
File List
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
rowcol.h
Go to the documentation of this file.
1
#ifndef _ROWCOL_H
2
#define _ROWCOL_H
3
4
/* these defines work with modeling coordinates only */
5
6
/* TODO: avoid integer overflow */
7
8
/* view resolutions */
9
#define VXRES(gs) (gs->x_mod * gs->xres)
10
#define VYRES(gs) (gs->y_mod * gs->yres)
11
12
/* number of viewres rows/cols */
13
#define VROWS(gs) (int)((gs->rows -1)/gs->y_mod)
14
#define VCOLS(gs) (int)((gs->cols -1)/gs->x_mod)
15
16
/* data row & col to offset */
17
#define DRC2OFF(gs, drow, dcol) (int)((dcol) + (drow) * gs->cols)
18
19
/* ycoord/xcoord to data row/col */
20
#define Y2DROW(gs,py) (int)((gs->yrange - (py))/gs->yres)
21
#define X2DCOL(gs,px) (int)((px)/gs->xres)
22
23
/* ycoord/xcoord to offset */
24
#define XY2OFF(gs, px, py) (int)DRC2OFF(gs, Y2DROW(gs,py), X2DCOL(gs,px))
25
26
/* ycoord/xcoord to viewres row/col */
27
#define Y2VROW(gs,py) (int)((gs->yrange - (py))/(gs->yres * gs->y_mod))
28
#define X2VCOL(gs,px) (int)((px)/(gs->xres * gs->x_mod))
29
30
/* viewres row/col to data row/col */
31
#define VROW2DROW(gs,vrow) (int)(gs->y_mod * (vrow))
32
#define VCOL2DCOL(gs,vcol) (int)(gs->x_mod * (vcol))
33
34
/* data row/col to ycoord/xcoord */
35
#define DROW2Y(gs,drow) (gs->yrange - ((drow) * gs->yres))
36
#define DCOL2X(gs,dcol) ((dcol) * gs->xres)
37
38
/* viewres row/col to ycoord/xcoord */
39
#define VROW2Y(gs,vrow) (gs->yrange - ((vrow) * gs->yres * gs->y_mod))
40
#define VCOL2X(gs,vcol) ((vcol) * gs->xres * gs->x_mod)
41
42
#endif
/* _ROWCOL_H */
lib
ogsf
rowcol.h
Generated on Mon May 31 2021 05:21:31 for GRASS GIS 7 Programmer's Manual by
1.8.13