GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72100
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
R.h
Go to the documentation of this file.
1 #include <grass/config.h>
2 #include <grass/gis.h>
3 #ifdef HAVE_GDAL
4 #include <gdal.h>
5 #endif
6 
7 #define XDR_FLOAT_NBYTES 4
8 #define XDR_DOUBLE_NBYTES 8
9 #define NULL_ROWS_INMEM 8
10 
11 /* if short is 16 bits, then
12  * short will allow 32767 cols
13  * unsigned short will allow 65536 cols
14  * use int if you need more columns (but this will take more memory).
15  *
16  */
17 typedef int COLUMN_MAPPING;
18 
19 struct GDAL_link
20 {
21  char *filename;
22  int band_num;
24  int hflip;
25  int vflip;
26 #ifdef HAVE_GDAL
27  GDALDatasetH data;
28  GDALRasterBandH band;
29  GDALDataType type;
30 #endif
31 };
32 
33 #ifdef HAVE_GDAL
34 extern CPLErr Rast_gdal_raster_IO(GDALRasterBandH, GDALRWFlag,
35  int, int, int, int,
36  void *, int, int, GDALDataType, int, int);
37 #endif
38 
39 struct fileinfo /* Information for opened cell files */
40 {
41  int open_mode; /* see defines below */
42  struct Cell_head cellhd; /* Cell header */
43  struct Reclass reclass; /* Table reclass */
44  struct Cell_stats statf; /* Cell stats */
45  struct Range range; /* Range structure */
46  struct FPRange fp_range; /* float Range structure */
48  int reclass_flag; /* Automatic reclass flag */
49  off_t *row_ptr; /* File row addresses */
50  COLUMN_MAPPING *col_map; /* Data to window col mapping */
51  double C1, C2; /* Data to window row constants */
52  int cur_row; /* Current data row in memory */
53  int null_cur_row; /* Current null row in memory */
54  int cur_nbytes; /* nbytes per cell for current row */
55  unsigned char *data; /* Decompressed data buffer */
56  int null_fd; /* Null bitmap fd */
57  unsigned char *null_bits; /* Null bitmap 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  struct Quant quant;
67  struct GDAL_link *gdal;
68  int data_fd; /* Raster data fd */
69  off_t *null_row_ptr; /* Null file row addresses */
70 };
71 
72 struct R__ /* Structure of library globals */
73 {
74  RASTER_MAP_TYPE fp_type; /* type for writing floating maps */
75  int mask_fd; /* File descriptor for automatic mask */
76  int auto_mask; /* Flag denoting automatic masking */
78  int nbytes;
81  int window_set; /* Flag: window set? */
82  int split_window; /* Separate windows for input and output */
83  struct Cell_head rd_window; /* Window used for input */
84  struct Cell_head wr_window; /* Window used for output */
85 
87  struct fileinfo *fileinfo;
88 };
89 
90 extern struct R__ R__; /* allocated in init */
91 
92 #define OPEN_OLD 1
93 #define OPEN_NEW_COMPRESSED 2
94 #define OPEN_NEW_UNCOMPRESSED 3
struct Cell_head rd_window
Definition: R.h:83
int nbytes
Definition: R.h:58
int want_histogram
Definition: R.h:47
RASTER_MAP_TYPE map_type
Definition: R.h:59
Definition: R.h:72
char * name
Definition: R.h:63
2D/3D raster map header (used also for region)
Definition: gis.h:390
int data_fd
Definition: R.h:68
off_t * row_ptr
Definition: R.h:49
double DCELL
Definition: gis.h:581
int io_error
Definition: R.h:65
RASTER_MAP_TYPE fp_type
Definition: R.h:74
char * temp_name
Definition: R.h:60
unsigned char * data
Definition: R.h:55
COLUMN_MAPPING * col_map
Definition: R.h:50
unsigned char * null_bits
Definition: R.h:57
struct GDAL_link * gdal
Definition: R.h:67
struct Range range
Definition: R.h:45
struct Reclass reclass
Definition: R.h:43
struct Cell_head wr_window
Definition: R.h:84
Definition: raster.h:31
double C1
Definition: R.h:51
struct Cell_stats statf
Definition: R.h:44
Definition: raster.h:84
int null_fd
Definition: R.h:56
int COLUMN_MAPPING
Definition: R.h:17
char * mapset
Definition: R.h:64
int open_mode
Definition: R.h:41
int cur_row
Definition: R.h:52
int mask_fd
Definition: R.h:75
int fileinfo_count
Definition: R.h:86
struct fileinfo * fileinfo
Definition: R.h:87
char * null_temp_name
Definition: R.h:61
Definition: raster.h:225
int auto_mask
Definition: R.h:76
int cur_nbytes
Definition: R.h:54
int window_set
Definition: R.h:81
double C2
Definition: R.h:51
int null_file_exists
Definition: R.h:62
int compress_nulls
Definition: R.h:80
off_t * null_row_ptr
Definition: R.h:69
struct Cell_head cellhd
Definition: R.h:42
Definition: R.h:39
int RASTER_MAP_TYPE
Definition: raster.h:25
int null_cur_row
Definition: R.h:53
struct Quant quant
Definition: R.h:66
int want_histogram
Definition: R.h:77
int nbytes
Definition: R.h:78
int split_window
Definition: R.h:82
struct FPRange fp_range
Definition: R.h:46
int compression_type
Definition: R.h:79
int reclass_flag
Definition: R.h:48