GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
G.h
Go to the documentation of this file.
1
#include <grass/config.h>
2
#include <grass/gis.h>
3
#include <rpc/types.h>
4
#include <rpc/xdr.h>
5
#ifdef HAVE_GDAL
6
#include <gdal.h>
7
#endif
8
9
#define XDR_FLOAT_NBYTES 4
10
#define XDR_DOUBLE_NBYTES 8
11
#define NULL_ROWS_INMEM 8
12
13
/* if short is 16 bits, then
14
* short will allow 32767 cols
15
* unsigned short will allow 65536 cols
16
* use int if you need more columns (but this will take more memory).
17
*
18
*/
19
typedef
int
COLUMN_MAPPING
;
20
21
struct
GDAL_link
22
{
23
char
*
filename
;
24
int
band_num
;
25
DCELL
null_val
;
26
#ifdef HAVE_GDAL
27
GDALDatasetH
data
;
28
GDALRasterBandH band;
29
GDALDataType
type
;
30
#endif
31
};
32
33
#ifdef HAVE_GDAL
34
extern
CPLErr G_gdal_raster_IO(
35
GDALRasterBandH, GDALRWFlag,
36
int
,
int
,
int
,
int
,
37
void
*,
int
,
int
, GDALDataType,
38
int
,
int
);
39
#endif
40
41
struct
fileinfo
/* Information for opened cell files */
42
{
43
int
open_mode
;
/* see defines below */
44
struct
Cell_head
cellhd
;
/* Cell header */
45
struct
Reclass
reclass
;
/* Table reclass */
46
struct
Cell_stats
statf
;
/* Cell stats */
47
struct
Range
range
;
/* Range structure */
48
struct
FPRange
fp_range
;
/* float Range structure */
49
int
want_histogram
;
50
int
reclass_flag
;
/* Automatic reclass flag */
51
off_t *
row_ptr
;
/* File row addresses */
52
COLUMN_MAPPING
*
col_map
;
/* Data to window col mapping */
53
double
C1
,
C2
;
/* Data to window row constants */
54
int
cur_row
;
/* Current data row in memory */
55
int
null_cur_row
;
/* Current null row in memory */
56
int
cur_nbytes
;
/* nbytes per cell for current row */
57
unsigned
char
*
data
;
/* Decompressed data buffer */
58
int
nbytes
;
/* bytes per cell */
59
RASTER_MAP_TYPE
map_type
;
/* type: int, float or double map */
60
char
*
temp_name
;
/* Temporary name for NEW files */
61
char
*
null_temp_name
;
/* Temporary name for NEW NULL files */
62
int
null_file_exists
;
/* for existing raster maps */
63
char
*
name
;
/* Name of open file */
64
char
*
mapset
;
/* Mapset of open file */
65
int
io_error
;
/* io error warning given */
66
XDR
xdrstream
;
/* xdr stream for reading fp */
67
unsigned
char
*
NULL_ROWS
[
NULL_ROWS_INMEM
];
68
unsigned
char
*
null_work_buf
;
/* data buffer for reading null rows */
69
int
min_null_row
;
/* Minimum row null row number in memory */
70
struct
Quant
quant
;
71
struct
GDAL_link
*
gdal
;
72
};
73
74
struct
G__
/* Structure of library globals */
75
{
76
int
fp_nbytes
;
/* size of cell in floating maps */
77
RASTER_MAP_TYPE
fp_type
;
/* type for writing floating maps */
78
struct
Cell_head
window
;
/* Contains the current window */
79
int
window_set
;
/* Flag: window set? */
80
int
mask_fd
;
/* File descriptor for automatic mask */
81
int
auto_mask
;
/* Flag denoting automatic masking */
82
CELL *
mask_buf
;
83
char
*
null_buf
;
/* buffer for reading null rows */
84
CELL *
temp_buf
;
85
unsigned
char
*
compressed_buf
;
/* Pre/post compressed data buffer */
86
int
compressed_buf_size
;
/* sizeof compressed_buf */
87
unsigned
char
*
work_buf
;
/* work data buffer */
88
int
work_buf_size
;
/* sizeof work_buf */
89
int
null_buf_size
;
/* sizeof null_buf */
90
int
mask_buf_size
;
/* sizeof mask_buf */
91
int
temp_buf_size
;
/* sizeof temp_buf */
92
int
want_histogram
;
93
94
int
fileinfo_count
;
95
struct
fileinfo
*
fileinfo
;
96
};
97
98
extern
struct
G__
G__
;
/* allocated in gisinit */
99
100
#define OPEN_OLD 1
101
#define OPEN_NEW_COMPRESSED 2
102
#define OPEN_NEW_UNCOMPRESSED 3
103
#define OPEN_NEW_RANDOM 4
lib
gis
G.h
Generated on Sun Mar 16 2014 05:07:44 for GRASS Programmer's Manual by
1.8.1.2