GRASS GIS 7 Programmer's Manual  7.9.dev(2020)-30b77ddcf
gis.h
Go to the documentation of this file.
1 /*
2  *****************************************************************************
3  *
4  * MODULE: Grass Include Files
5  * AUTHOR(S): Original author unknown - probably CERL
6  * Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
7  * PURPOSE: This file contains definitions of variables and data types
8  * for use with most, if not all, Grass programs. This file is
9  * usually included in every Grass program.
10  * COPYRIGHT: (C) 2000-2011 by the GRASS Development Team
11  *
12  * This program is free software under the GNU General Public
13  * License (>=v2). Read the file COPYING that comes with GRASS
14  * for details.
15  *
16  *****************************************************************************/
17 
18 #ifndef GRASS_GIS_H
19 #define GRASS_GIS_H
20 
21 /*============================= Include Files ==============================*/
22 
23 /* System include files */
24 #include <stdio.h>
25 #include <stdarg.h>
26 
27 /* Grass and local include files */
28 #include <grass/config.h>
29 #include <grass/datetime.h>
30 #include <grass/version.h>
31 
32 /*=========================== Constants/Defines ============================*/
33 
34 #if !defined __GNUC__ || __GNUC__ < 2
35 #undef __attribute__
36 #define __attribute__(x)
37 #endif
38 
39 static const char *GRASS_copyright __attribute__ ((unused))
40  = "GRASS GNU GPL licensed Software";
41 
42 /* GRASS version, GRASS date, git short hash of last change in GRASS headers
43  * (and anything else in include)
44  */
45 #define GIS_H_VERSION GRASS_HEADERS_VERSION
46 /* git date of last change in GRASS headers
47  * (and anything else in include)
48  */
49 #define GIS_H_DATE GRASS_HEADERS_DATE
50 
51 #define G_gisinit(pgm) G__gisinit(GIS_H_VERSION, (pgm))
52 #define G_no_gisinit() G__no_gisinit(GIS_H_VERSION)
53 
54 /* Define TRUE and FALSE for boolean comparisons */
55 #ifndef TRUE
56 #define TRUE 1
57 #endif
58 
59 #ifndef FALSE
60 #define FALSE 0
61 #endif
62 
63 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
64 #define PRI_OFF_T "lld"
65 #else
66 #define PRI_OFF_T "ld"
67 #endif
68 
69 /*! \brief Cross-platform Newline Character */
70 #define NEWLINE '\n'
71 #ifdef __MINGW32__
72 # define HOST_NEWLINE "\r\n"
73 #else
74 # define HOST_NEWLINE "\n"
75 #endif
76 
77 /*! \brief Generate warning if function return value is unused */
78 #if __GNUC__ && (__GNUC__ >= 3 && __GNUC_MINOR__ >= 4)
79 # define WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
80 #else
81 # define WARN_UNUSED_RESULT
82 #endif
83 
84 /*!
85  \brief List of units
86 */
87 #define U_UNDEFINED -1
88 #define U_UNKNOWN 0
89 #define U_ACRES 1
90 #define U_HECTARES 2
91 #define U_KILOMETERS 3
92 #define U_METERS 4
93 #define U_MILES 5
94 #define U_FEET 6
95 #define U_RADIANS 7
96 #define U_DEGREES 8
97 #define U_USFEET 9
98 /* Temporal units from the datetime library */
99 #define U_YEARS DATETIME_YEAR
100 #define U_MONTHS DATETIME_MONTH
101 #define U_DAYS DATETIME_DAY
102 #define U_HOURS DATETIME_HOUR
103 #define U_MINUTES DATETIME_MINUTE
104 #define U_SECONDS DATETIME_SECOND
105 
106 /*! \brief Projection code - XY coordinate system (unreferenced data) */
107 #define PROJECTION_XY 0
108 /*! \brief Projection code - UTM */
109 #define PROJECTION_UTM 1
110 /*! \brief Projection code - State Plane */
111 #define PROJECTION_SP 2
112 /*! \brief Projection code - Latitude-Longitude */
113 #define PROJECTION_LL 3
114 /*! \brief Projection code - other projection (other then noted above) */
115 #define PROJECTION_OTHER 99
116 
117 #define PROJECTION_FILE "PROJ_INFO"
118 #define UNIT_FILE "PROJ_UNITS"
119 #define EPSG_FILE "PROJ_EPSG"
120 #define WKT_FILE "PROJ_WKT"
121 #define SRID_FILE "PROJ_SRID"
122 
123 #ifdef __MINGW32__
124 #define CONFIG_DIR "GRASS7"
125 #else
126 #define CONFIG_DIR ".grass7"
127 #endif
128 
129 /* define PI and friends */
130 #undef M_PI
131 #define M_PI 3.14159265358979323846 /* pi */
132 
133 #undef M_PI_2
134 #define M_PI_2 1.57079632679489661923 /* pi/2 */
135 
136 #undef M_PI_4
137 #define M_PI_4 0.78539816339744830962 /* pi/4 */
138 
139 #undef M_R2D
140 #define M_R2D 57.295779513082320877 /* 180/pi */
141 
142 #undef M_D2R
143 #define M_D2R 0.017453292519943295769 /* pi/180 */
144 
145 /* epsilon (IEEE: 2.220446e-16) */
146 #define GRASS_EPSILON 1.0e-15
147 
148 /* Location of envariment variables */
149 #define G_VAR_GISRC 0
150 #define G_VAR_MAPSET 1
151 
152 /* Where to find/store variables */
153 #define G_GISRC_MODE_FILE 0 /* files */
154 #define G_GISRC_MODE_MEMORY 1 /* memory only */
155 
156 /* for G_parser() */
157 #define TYPE_INTEGER 1
158 #define TYPE_DOUBLE 2
159 #define TYPE_STRING 3
160 #define YES 1
161 #define NO 0
162 
163 /* File/directory name lengths */
164 #define GNAME_MAX 256
165 #define GMAPSET_MAX 256
166 
167 #define GPATH_MAX 4096
168 
169 /* Basename default separator */
170 #define GBASENAME_SEP "_"
171 
172 /* Macros for type size independent integers */
173 /* Use these for portability to ensure integers are truly 32bit */
174 /* and are handled in a uniform manner */
175 
176 /* Convert integer to 4 bytes - little endian */
177 #define serialize_int32_le(buf, x) do { \
178  (buf)[0] = ((x) >> 0) & 0xFF; \
179  (buf)[1] = ((x) >> 8) & 0xFF; \
180  (buf)[2] = ((x) >> 16) & 0xFF; \
181  (buf)[3] = ((x) >> 24) & 0xFF; \
182 } while(0)
183 
184 /* Convert 4 bytes to an integer - little endian */
185 #define deserialize_int32_le(buf) (((buf)[0] << 0) | \
186  ((buf)[1] << 8) | \
187  ((buf)[2] << 16) | \
188  ((buf)[3] << 24))
189 
190 /* Convert integer to 4 bytes - big endian */
191 #define serialize_int32_be(buf, x) do { \
192  (buf)[0] = ((x) >> 24) & 0xFF; \
193  (buf)[1] = ((x) >> 16) & 0xFF; \
194  (buf)[2] = ((x) >> 8) & 0xFF; \
195  (buf)[3] = ((x) >> 0) & 0xFF; \
196 } while(0)
197 
198 /* Convert 4 bytes to an integer - big endian */
199 #define deserialize_int32_be(buf) (((buf)[0] << 24) | \
200  ((buf)[1] << 16) | \
201  ((buf)[2] << 8) | \
202  ((buf)[3] << 0))
203 
204 /* Cross-platform Directory Separator Character and null device stuff */
205 #define GRASS_DIRSEP '/'
206 #ifdef __MINGW32__
207 # define HOST_DIRSEP '\\'
208 # define G_DEV_NULL "NUL:"
209 #else
210 # define HOST_DIRSEP '/'
211 # define G_DEV_NULL "/dev/null"
212 #endif
213 
214 /*!
215  \typedef STD_OPT
216  \brief Standard option identifiers (enum)
217 
218  Identifies of all recognized standard options.
219 
220  The term <em>old</em> in the descriptions means existing map which
221  is supposed to exist before the module is called.
222  On the other hand, the term <em>new</em> in the descriptions means
223  that the map is not supposed to exist and that module will create one.
224 
225  Used by the G_parser() system.
226 
227  IMPORTANT NOTE: when adding new item to STD_OPT you should also
228  update STD_OPT_STRINGS array in general/g.parser/standard_option.c.
229 
230 */
231 typedef enum
232 {
234  G_OPT_DB_SQL, /*!< SQL statements */
235  G_OPT_DB_WHERE, /*!< SQL where conditions */
236  G_OPT_DB_TABLE, /*!< table name */
237  G_OPT_DB_DRIVER, /*!< driver name */
238  G_OPT_DB_DATABASE, /*!< database name */
239  G_OPT_DB_SCHEMA, /*!< database schema */
240  G_OPT_DB_COLUMN, /*!< one attr column */
241  G_OPT_DB_COLUMNS, /*!< one or more attr columns */
242  G_OPT_DB_KEYCOLUMN, /*!< key column */
243 
244  G_OPT_I_GROUP, /*!< old input imagery group */
245  G_OPT_I_SUBGROUP, /*!< old input imagery subgroup */
246 
247  G_OPT_MEMORYMB, /*!< Maximum memory to be used (in MB): cache size for raster rows */
248  G_OPT_R_INPUT, /*!< old input raster map */
249  G_OPT_R_INPUTS, /*!< old input raster maps */
250  G_OPT_R_OUTPUT, /*!< new output raster map */
251  G_OPT_R_OUTPUTS, /*!< new output raster maps */
252  G_OPT_R_MAP, /*!< old input raster map */
253  G_OPT_R_MAPS, /*!< old input rasters map */
254  G_OPT_R_BASE, /*!< old input base raster map */
255  G_OPT_R_COVER, /*!< old input cover raster map */
256  G_OPT_R_ELEV, /*!< old input elevation raster map */
257  G_OPT_R_ELEVS, /*!< old input elevation raster maps */
258  G_OPT_R_TYPE, /*!< raster map type */
259  G_OPT_R_INTERP_TYPE, /*!< interpolation type */
260  G_OPT_R_BASENAME_INPUT, /*!< old input basename raster maps */
261  G_OPT_R_BASENAME_OUTPUT, /*!< new output basename raster maps */
262 
263  G_OPT_R3_INPUT, /*!< old input raster3d map */
264  G_OPT_R3_INPUTS, /*!< old input raster3d maps */
265  G_OPT_R3_OUTPUT, /*!< new output raster3d map */
266  G_OPT_R3_MAP, /*!< old input raster3d map */
267  G_OPT_R3_MAPS, /*!< old input raster3d maps */
268  G_OPT_R3_TYPE, /*!< Type (FCELL or DCELL) of a new created raster3d map */
269  G_OPT_R3_PRECISION, /*!< The precision of the new generated raster3d map */
270  G_OPT_R3_TILE_DIMENSION, /*!< The tile dimension of a new generated raster3d map */
271  G_OPT_R3_COMPRESSION, /*!< The kind of compression of a new created raster3d map */
272 
273  G_OPT_V_INPUT, /*!< old input vector map */
274  G_OPT_V_INPUTS, /*!< old input vector maps */
275  G_OPT_V_OUTPUT, /*!< new output vector map */
276  G_OPT_V_MAP, /*!< old input vector map */
277  G_OPT_V_MAPS, /*!< old input vector maps */
278  G_OPT_V_TYPE, /*!< primitive type */
279  G_OPT_V3_TYPE, /*!< primitive type, 2D and 3D */
280  G_OPT_V_FIELD, /*!< layer number (layers used to be called fields) */
281  G_OPT_V_FIELD_ALL, /*!< layer number (layers used to be called fields) */
282  G_OPT_V_CAT, /*!< one category */
283  G_OPT_V_CATS, /*!< more categories */
284  G_OPT_V_ID, /*!< one feature id */
285  G_OPT_V_IDS, /*!< more feature ids */
286 
287  G_OPT_F_INPUT, /*!< old input file */
288  G_OPT_F_BIN_INPUT, /*!< old binary input file */
289  G_OPT_F_OUTPUT, /*!< new output file */
290  G_OPT_F_SEP, /*!< data field separator */
291 
292  G_OPT_C, /*!< color */
293  G_OPT_CN, /*!< color or none */
294 
295  G_OPT_M_UNITS, /*!< units */
296  G_OPT_M_DATATYPE, /*!< datatype */
297  G_OPT_M_MAPSET, /*!< mapset */
298  G_OPT_M_LOCATION, /*!< location */
299  G_OPT_M_DBASE, /*!< dbase */
300  G_OPT_M_COORDS, /*!< coordinates */
301  G_OPT_M_COLR, /*!< color rules */
302  G_OPT_M_DIR, /*!< directory input */
303  G_OPT_M_REGION, /*!< saved region */
304  G_OPT_M_NULL_VALUE, /*!< null value string */
305 
306  G_OPT_STDS_INPUT, /*!< old input space time dataset of type strds, str3ds or stvds */
307  G_OPT_STDS_INPUTS, /*!< old input space time datasets */
308  G_OPT_STDS_OUTPUT, /*!< new output space time dataset */
309  G_OPT_STRDS_INPUT, /*!< old input space time raster dataset */
310  G_OPT_STRDS_INPUTS, /*!< old input space time raster datasets */
311  G_OPT_STRDS_OUTPUT, /*!< new output space time raster dataset */
312  G_OPT_STRDS_OUTPUTS, /*!< new output space time raster datasets */
313  G_OPT_STR3DS_INPUT, /*!< old input space time raster3d dataset */
314  G_OPT_STR3DS_INPUTS, /*!< old input space time raster3d datasets */
315  G_OPT_STR3DS_OUTPUT, /*!< new output space time raster3d dataset */
316  G_OPT_STVDS_INPUT, /*!< old input space time vector dataset */
317  G_OPT_STVDS_INPUTS, /*!< old input space time vector datasets */
318  G_OPT_STVDS_OUTPUT, /*!< new output space time vector dataset */
319  G_OPT_MAP_INPUT, /*!< old input map of type raster, vector or raster3d */
320  G_OPT_MAP_INPUTS, /*!< old input maps of type raster, vector or raster3d */
321  G_OPT_STDS_TYPE, /*!< the type of a space time dataset: strds, str3ds, stvds */
322  G_OPT_MAP_TYPE, /*!< The type of an input map: raster, vect, rast3d */
323  G_OPT_T_TYPE, /*!< The temporal type of a space time dataset */
324  G_OPT_T_WHERE, /*!< A temporal GIS framework SQL WHERE statement */
325  G_OPT_T_SAMPLE /*!< Temporal sample methods */
326 
327 } STD_OPT;
328 
329 /*!
330  \typedef STD_FLG
331  \brief Standard flag identifiers (enum)
332 
333  Identifies of all recognized standard flags.
334 
335  Used by the G_parser() system.
336 */
337 
338 /**/ typedef enum
339 {
341  G_FLG_V_TABLE, /*!< do not create attribute table */
342  G_FLG_V_TOPO /*!< do not build topology */
343 } STD_FLG;
344 
345 /* Parser rules for G__option_rule() */
346 enum rule_type {
353 };
354 
355 /* Message format */
356 #define G_INFO_FORMAT_STANDARD 0 /* GRASS_MESSAGE_FORMAT=standard or not defined */
357 #define G_INFO_FORMAT_GUI 1 /* GRASS_MESSAGE_FORMAT=gui */
358 #define G_INFO_FORMAT_SILENT 2 /* GRASS_MESSAGE_FORMAT=silent */
359 #define G_INFO_FORMAT_PLAIN 3 /* GRASS_MESSAGE_FORMAT=plain */
360 
361 /* Icon types */
362 #define G_ICON_CROSS 0
363 #define G_ICON_BOX 1
364 #define G_ICON_ARROW 2
365 
366 /* default colors */
367 #define DEFAULT_FG_COLOR "black"
368 #define DEFAULT_BG_COLOR "white"
369 #define DEFAULT_COLOR_TABLE "viridis"
370 
371 /* error codes */
372 #define G_FATAL_EXIT 0
373 #define G_FATAL_PRINT 1
374 #define G_FATAL_RETURN 2
375 
376 /*! \brief Endian check */
377 #define ENDIAN_LITTLE 0
378 #define ENDIAN_BIG 1
379 #define ENDIAN_OTHER 2
380 
381 /* for vector maps */
382 /*!
383  \brief Name of default key column
384 */
385 #define GV_KEY_COLUMN "cat"
386 
387 /*!
388  \brief Element types identifiers (enum)
389 
390  Identifies various element types. Element can be raster map,
391  vector map, etc.
392 */
393 enum
394 { /* Dir */
395  G_ELEMENT_RASTER = 1, /*!< raster */
396  G_ELEMENT_RASTER3D = 2, /*!< 3d raster */
397  G_ELEMENT_VECTOR = 3, /*!< vector */
398  G_ELEMENT_ASCIIVECTOR = 4, /*!< ASCII vector */
399  G_ELEMENT_LABEL = 5, /*!< labels */
400  G_ELEMENT_REGION = 6, /*!< region */
401  G_ELEMENT_GROUP = 7 /*!< group */
402 };
403 
404 /*=========================== Typedefs/Structures ==========================*/
405 
406 /*!
407  \brief 2D/3D raster map header (used also for region)
408 */
409 struct Cell_head
410 {
411  /*! \brief Max number of bytes per raster data value minus 1 (raster header only)
412 
413  Note: -1 for FP raster maps
414  */
415  int format;
416  /*! \brief Compression mode (raster header only)
417 
418  - 0: uncompressed
419  - 1: compressed
420  - -1: pre GRASS 3.0
421  */
423  /*! \brief Number of rows for 2D data */
424  int rows;
425  /*! \brief Number of rows for 3D data */
426  int rows3;
427  /*! \brief Number of columns for 2D data */
428  int cols;
429  /*! \brief Number of columns for 3D data */
430  int cols3;
431  /*! \brief number of depths for 3D data */
432  int depths;
433  /*! \brief Projection code
434 
435  - PROJECTION_XY
436  - PROJECTION_UTM
437  - PROJECTION_SP
438  - PROJECTION_LL
439  - PROJECTION_OTHER
440  */
441  int proj;
442  /*! \brief Projection zone (UTM) */
443  int zone;
444  /*! \brief Resolution - east to west cell size for 2D data */
445  double ew_res;
446  /*! \brief Resolution - east to west cell size for 3D data */
447  double ew_res3;
448  /*! \brief Resolution - north to south cell size for 2D data */
449  double ns_res;
450  /*! \brief Resolution - north to south cell size for 3D data */
451  double ns_res3;
452  /*! \brief Resolution - top to bottom cell size for 3D data */
453  double tb_res;
454  /*! \brief Extent coordinates (north) */
455  double north;
456  /*! \brief Extent coordinates (south) */
457  double south;
458  /*! \brief Extent coordinates (east) */
459  double east;
460  /*! \brief Extent coordinates (west) */
461  double west;
462  /*! \brief Extent coordinates (top) - 3D data*/
463  double top;
464  /*! \brief Extent coordinates (bottom) - 3D data */
465  double bottom;
466 };
467 
468 /*
469  ** Structure for I/O of 3dview files (view.c)
470  */
471 struct G_3dview
472 {
473  char pgm_id[40]; /* user-provided identifier */
474  float from_to[2][3]; /* eye position & lookat position */
475  float fov; /* field of view */
476  float twist; /* right_hand rotation about from_to */
477  float exag; /* terrain elevation exageration */
478  int mesh_freq; /* cells per grid line */
479  int poly_freq; /* cells per polygon */
480  int display_type; /* 1 for mesh, 2 for poly, 3 for both */
481  int lightson; /* boolean */
482  int dozero; /* boolean */
483  int colorgrid; /* boolean */
484  int shading; /* boolean */
485  int fringe; /* boolean */
486  int surfonly; /* boolean */
487  int doavg; /* boolean */
488  char grid_col[40]; /* colors */
489  char bg_col[40]; /* colors */
490  char other_col[40]; /* colors */
491  float lightpos[4]; /* east, north, height, 1.0 for local 0.0 infin */
492  float lightcol[3]; /* values between 0.0 to 1.0 for red, grn, blu */
493  float ambient;
494  float shine;
495  struct Cell_head vwin;
496 };
497 
498 struct Key_Value
499 {
500  int nitems;
501  int nalloc;
502  char **key;
503  char **value;
504 };
505 
506 /*!
507  \brief Structure that stores option information
508 
509  The descriptions member contains pairs of option and option
510  descriptions separated by semicolon ';'.
511  For example, when options member is set using:
512  \code
513  opt->options = "break,rmdupl"
514  \endcode
515  the descriptions member should be set to:
516  \verbatim
517  "break;break lines on intersections;"
518  "rmdupl;remove duplicates"
519  \endverbatim
520 
521  Parsed descriptions are stored in the same order as options.
522 
523  GUI dependency is a list of options (separated by commas) to be updated
524  if the value is changed.
525 
526  Used by the G_parser() system.
527 */
528 struct Option
529 {
530  const char *key; /*!< Key word used on command line */
531  int type; /*!< Option type */
532  int required; /*!< REQUIRED or OPTIONAL */
533  int multiple; /*!< Multiple entries OK */
534  const char *options; /*!< Approved values or range or NULL */
535  const char **opts; /*!< NULL or NULL terminated array of parsed options */
536  const char *key_desc; /*!< one word describing the key */
537  const char *label; /*!< Optional short label, used in GUI as item label */
538  const char *description; /*!< String describing option */
539  const char *descriptions; /*!< ';' separated pairs of option and option descriptions */
540  const char **descs; /*!< parsed descriptions, array of either NULL or string */
541  char *answer; /*!< Option answer */
542  const char *def; /*!< Where original answer gets saved */
543  char **answers; /*!< Option answers (for multiple=YES) */
544  struct Option *next_opt; /*!< Pointer to next option struct */
545  const char *gisprompt; /*!< Interactive prompt guidance */
546  const char *guisection; /*!< GUI Layout guidance: ';' delimited hierarchical tree position */
547  const char *guidependency; /*!< GUI dependency */
548  int (*checker)(const char *);/*!< Routine to check answer or NULL */
549  int count;
550 };
551 
552 /*!
553  \brief Structure that stores flag info
554 
555  Used by the G_parser() system.
556 */
557 struct Flag
558 {
559  char key; /*!< Key char used on command line */
560  char answer; /*!< Stores flag state: 0/1 */
561  char suppress_required; /*!< Suppresses checking of required options */
562  char suppress_overwrite; /*!< Suppresses checking of existing output */
563  const char *label; /*!< Optional short label, used in GUI as item label */
564  const char *description; /*!< String describing flag meaning */
565  const char *guisection; /*!< GUI Layout guidance: ';' delimited hierarchical tree position */
566  struct Flag *next_flag; /*!< Pointer to next flag struct */
567 };
568 
569 /*!
570  \brief Structure that stores module info
571 
572  Used by the G_parser() system.
573 */
574 struct GModule
575 {
576  const char *label; /*!< Optional short description for GUI */
577  const char *description; /*!< String describing module */
578  const char **keywords; /*!< Keywords describing module */
579  /* further items are possible: author(s), version, year */
580  int overwrite; /*!< overwrite old files */
581  int verbose; /*!< print all information about progress and so on */
582 };
583 
584 struct TimeStamp
585 {
586  DateTime dt[2]; /* two datetimes */
587  int count;
588 };
589 
590 struct Counter {
591  int value;
592 };
593 
594 struct Popen {
595  FILE *fp;
596  int pid;
597 };
598 
599 typedef int CELL;
600 typedef double DCELL;
601 typedef float FCELL;
602 
603 /* 64 bit signed integer */
604 #if HAVE_INT64_T
605 #include <sys/types.h>
606 typedef int64_t grass_int64;
607 #elif defined(__MINGW32__)
608 typedef __int64 grass_int64;
609 #elif HAVE_LONG_LONG_INT
610 typedef long long int grass_int64;
611 #elif HAVE_LARGEFILES
612 typedef off_t grass_int64;
613 #else
614 #error "no 64 bit integer available"
615 #endif
616 
617 /* LCELL = large CELL, proposed new raster data type */
618 typedef grass_int64 LCELL;
619 
621 {
622  DCELL value;
623  unsigned char red;
624  unsigned char grn;
625  unsigned char blu;
626 };
627 
629 {
630  struct _Color_Value_ low, high;
633 };
634 
636 {
638  int n_rules;
639 
640  struct
641  {
642  unsigned char *red;
643  unsigned char *grn;
644  unsigned char *blu;
645  unsigned char *set;
646  int nalloc;
647  int active;
648  } lookup;
649 
650  struct
651  {
652  DCELL *vals;
653  /* pointers to color rules corresponding to the intervals btwn vals */
654  struct _Color_Rule_ **rules;
655  int nalloc;
656  int active;
657  } fp_lookup;
658 
659  DCELL min, max;
660 };
661 
662 struct Colors
663 {
664  int version; /* set by read_colors: -1=old,1=new */
665  DCELL shift;
666  int invert;
667  int is_float; /* defined on floating point raster data? */
668  int null_set; /* the colors for null are set? */
669  unsigned char null_red;
670  unsigned char null_grn;
671  unsigned char null_blu;
672  int undef_set; /* the colors for cells not in range are set? */
673  unsigned char undef_red;
674  unsigned char undef_grn;
675  unsigned char undef_blu;
676  struct _Color_Info_ fixed;
677  struct _Color_Info_ modular;
678  DCELL cmin;
679  DCELL cmax;
681 };
682 
683 /*!
684  \brief List of integers
685 */
686 struct ilist
687 {
688  /*!
689  \brief Array of values
690  */
691  int *value;
692  /*!
693  \brief Number of values in the list
694  */
695  int n_values;
696  /*!
697  \brief Allocated space for values
698  */
700 };
701 
702 /*============================== Prototypes ================================*/
703 
704 /* Since there are so many prototypes for the gis library they are stored */
705 /* in the file gisdefs.h */
706 #include <grass/defs/gis.h>
707 
708 #endif /* GRASS_GIS_H */
const char ** opts
Definition: gis.h:535
int colorgrid
Definition: gis.h:483
int null_set
Definition: gis.h:668
const char * guidependency
Definition: gis.h:547
unsigned char null_blu
Definition: gis.h:671
int count
Definition: gis.h:549
unsigned char * blu
Definition: gis.h:644
float twist
Definition: gis.h:476
DCELL shift
Definition: gis.h:665
unsigned char * red
Definition: gis.h:642
char answer
Definition: gis.h:560
2D/3D raster map header (used also for region)
Definition: gis.h:409
struct _Color_Rule_ ** rules
Definition: gis.h:654
const char ** keywords
Definition: gis.h:578
int version
Definition: gis.h:664
double west
Extent coordinates (west)
Definition: gis.h:461
unsigned char null_grn
Definition: gis.h:670
double DCELL
Definition: gis.h:600
int poly_freq
Definition: gis.h:479
const char * label
Definition: gis.h:576
const char * descriptions
Definition: gis.h:539
DCELL cmax
Definition: gis.h:679
int fringe
Definition: gis.h:485
Definition: gis.h:590
int n_values
Number of values in the list.
Definition: gis.h:695
unsigned char undef_red
Definition: gis.h:673
struct _Color_Rule_ * next
Definition: gis.h:631
int doavg
Definition: gis.h:487
rule_type
Definition: gis.h:346
unsigned char * grn
Definition: gis.h:643
int is_float
Definition: gis.h:667
int nalloc
Definition: gis.h:646
Structure that stores module info.
Definition: gis.h:574
int display_type
Definition: gis.h:480
float ambient
Definition: gis.h:493
float shine
Definition: gis.h:494
int format
Max number of bytes per raster data value minus 1 (raster header only)
Definition: gis.h:415
#define max(x, y)
Definition: draw2.c:32
DCELL * vals
Definition: gis.h:652
Definition: gis.h:293
const char * def
Definition: gis.h:542
int cols3
Number of columns for 3D data.
Definition: gis.h:430
int pid
Definition: gis.h:596
int shading
Definition: gis.h:484
double top
Extent coordinates (top) - 3D data.
Definition: gis.h:463
grass_int64 LCELL
Definition: gis.h:618
int dozero
Definition: gis.h:482
DCELL cmin
Definition: gis.h:678
const char * guisection
Definition: gis.h:565
const char * description
Definition: gis.h:538
int type
Definition: gis.h:531
DCELL min
Definition: gis.h:659
int verbose
Definition: gis.h:581
int compressed
Compression mode (raster header only)
Definition: gis.h:422
double north
Extent coordinates (north)
Definition: gis.h:455
double ns_res3
Resolution - north to south cell size for 3D data.
Definition: gis.h:451
int organizing
Definition: gis.h:680
int rows3
Number of rows for 3D data.
Definition: gis.h:426
Definition: gis.h:594
char ** value
Definition: gis.h:503
char * answer
Definition: gis.h:541
double south
Extent coordinates (south)
Definition: gis.h:457
DCELL value
Definition: gis.h:622
int mesh_freq
Definition: gis.h:478
const char * guisection
Definition: gis.h:546
int multiple
Definition: gis.h:533
int zone
Projection zone (UTM)
Definition: gis.h:443
Structure that stores flag info.
Definition: gis.h:557
float fov
Definition: gis.h:475
int lightson
Definition: gis.h:481
char key
Definition: gis.h:559
int required
Definition: gis.h:532
double bottom
Extent coordinates (bottom) - 3D data.
Definition: gis.h:465
int value
Definition: gis.h:591
char ** key
Definition: gis.h:502
char suppress_overwrite
Definition: gis.h:562
int depths
number of depths for 3D data
Definition: gis.h:432
int proj
Projection code.
Definition: gis.h:441
struct Flag * next_flag
Definition: gis.h:566
int alloc_values
Allocated space for values.
Definition: gis.h:699
unsigned char null_red
Definition: gis.h:669
Definition: gis.h:498
float FCELL
Definition: gis.h:601
Definition: gis.h:662
const char * label
Definition: gis.h:563
int nalloc
Definition: gis.h:501
int active
Definition: gis.h:647
Definition: gis.h:471
const char * label
Definition: gis.h:537
const char ** descs
Definition: gis.h:540
int n_rules
Definition: gis.h:638
int cols
Number of columns for 2D data.
Definition: gis.h:428
unsigned char undef_blu
Definition: gis.h:675
unsigned char undef_grn
Definition: gis.h:674
double ns_res
Resolution - north to south cell size for 2D data.
Definition: gis.h:449
int invert
Definition: gis.h:666
char suppress_required
Definition: gis.h:561
int CELL
Definition: gis.h:599
unsigned char red
Definition: gis.h:623
int undef_set
Definition: gis.h:672
Structure that stores option information.
Definition: gis.h:528
double east
Extent coordinates (east)
Definition: gis.h:459
STD_FLG
Standard flag identifiers (enum)
Definition: gis.h:338
List of integers.
Definition: gis.h:686
unsigned char blu
Definition: gis.h:625
int nitems
Definition: gis.h:500
const char * description
Definition: gis.h:564
Definition: gis.h:584
int * value
Array of values.
Definition: gis.h:691
Definition: gis.h:292
int(* checker)(const char *)
Definition: gis.h:548
char ** answers
Definition: gis.h:543
float exag
Definition: gis.h:477
const char * key
Definition: gis.h:530
const char * description
Definition: gis.h:577
const char * gisprompt
Definition: gis.h:545
unsigned char grn
Definition: gis.h:624
const char * options
Definition: gis.h:534
double ew_res
Resolution - east to west cell size for 2D data.
Definition: gis.h:445
int count
Definition: gis.h:587
double tb_res
Resolution - top to bottom cell size for 3D data.
Definition: gis.h:453
int surfonly
Definition: gis.h:486
int rows
Number of rows for 2D data.
Definition: gis.h:424
struct _Color_Rule_ * prev
Definition: gis.h:632
const char * key_desc
Definition: gis.h:536
int overwrite
Definition: gis.h:580
#define __attribute__(x)
Definition: gis.h:36
FILE * fp
Definition: gis.h:595
STD_OPT
Standard option identifiers (enum)
Definition: gis.h:231
double ew_res3
Resolution - east to west cell size for 3D data.
Definition: gis.h:447
struct Option * next_opt
Definition: gis.h:544
struct _Color_Rule_ * rules
Definition: gis.h:637