raster3d_intern.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #include <rpc/types.h>
  2. #include <rpc/xdr.h>
  3. /*---------------------------------------------------------------------------*/
  4. #include <grass/raster3d.h>
  5. #include <grass/gis.h>
  6. /*---------------------------------------------------------------------------*/
  7. #define RASTER3D_LONG_LENGTH sizeof (long)
  8. #define RASTER3D_XDR_INT_LENGTH 4
  9. #define RASTER3D_XDR_DOUBLE_LENGTH 8
  10. #define RASTER3D_XDR_FLOAT_LENGTH 4
  11. #define RASTER3D_IS_CORRECT_TYPE(t) (((t) == FCELL_TYPE) || ((t) == DCELL_TYPE))
  12. #define RASTER3D_WRITE_DATA 1
  13. #define RASTER3D_READ_DATA 0
  14. #define RASTER3D_VALID_OPERATION(o) \
  15. (((o) == RASTER3D_WRITE_DATA) || ((o) == RASTER3D_READ_DATA))
  16. #define RASTER3D_MIN(a,b) ((a) <= (b) ? (a) : (b))
  17. #define RASTER3D_MAX(a,b) ((a) >= (b) ? (a) : (b))
  18. #define RASTER3D_HAS_INDEX 1
  19. #define RASTER3D_NO_INDEX 0
  20. #define RASTER3D_USE_XDR 1
  21. #define RASTER3D_NO_XDR 0
  22. #define RASTER3D_VALID_XDR_OPTION(o) (((o) == RASTER3D_USE_XDR) || ((o) == RASTER3D_NO_XDR))
  23. /*---------------------------------------------------------------------------*/
  24. /* global arrays */
  25. extern void *tmpCompress; /* compression support array */
  26. extern int tmpCompressLength; /* in bytes */
  27. extern void *xdr; /* xdr support array */
  28. extern int xdrLength; /* in bytes */
  29. /*---------------------------------------------------------------------------*/
  30. /* global variables */
  31. extern int g3d_do_compression; /* RASTER3D_NO_COMPRESSION or RASTER3D_COMPRESSION */
  32. extern int g3d_do_lzw_compression; /* RASTER3D_USE_LZW or RASTER3D_NO_LZW */
  33. extern int g3d_do_rle_compression; /* RASTER3D_USE_RLE or RASTER3D_NO_RLE */
  34. extern int g3d_precision; /* RASTER3D_ALLOW_PRECISION or RASTER3D_NO_PRECISION */
  35. extern int g3d_cache_default; /* in number of tiles; 0 ==> no cache */
  36. extern int g3d_cache_max; /* in bytes */
  37. extern int g3d_file_type; /* FCELL_TYPE or DCELL_TYPE */
  38. extern int g3d_tile_dimension[3];
  39. extern void (*g3d_error_fun) (const char *);
  40. extern char *g3d_unit_default;
  41. extern RASTER3D_Region g3d_window;
  42. /*---------------------------------------------------------------------------*/
  43. extern void Rast3d_fatal_error(const char * /* msg */ , ...);
  44. extern void Rast3d_fatal_error_noargs(const char * /* msg */ );
  45. /*---------------------------------------------------------------------------*/
  46. /*---------------------------------------------------------------------------*/
  47. #define RASTER3D_REGION_NORTH "North"
  48. #define RASTER3D_REGION_SOUTH "South"
  49. #define RASTER3D_REGION_EAST "East"
  50. #define RASTER3D_REGION_WEST "West"
  51. #define RASTER3D_REGION_TOP "Top"
  52. #define RASTER3D_REGION_BOTTOM "Bottom"
  53. #define RASTER3D_REGION_ROWS "nofRows"
  54. #define RASTER3D_REGION_COLS "nofCols"
  55. #define RASTER3D_REGION_DEPTHS "nofDepths"
  56. #define RASTER3D_REGION_PROJ "Proj"
  57. #define RASTER3D_REGION_ZONE "Zone"
  58. #define RASTER3D_REGION_EWRES "e-w resol"
  59. #define RASTER3D_REGION_NSRES "n-s resol"
  60. #define RASTER3D_REGION_TBRES "t-b resol"