G3d.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. #ifndef GRASS_G3D_H
  2. #define GRASS_G3D_H
  3. #include <grass/gis.h>
  4. #include <grass/raster.h>
  5. #define G3D_TILE_SAME_AS_FILE 2
  6. #define G3D_NO_COMPRESSION 0
  7. #define G3D_COMPRESSION 1
  8. #define G3D_USE_LZW 1
  9. #define G3D_NO_LZW 0
  10. #define G3D_USE_RLE 1
  11. #define G3D_NO_RLE 0
  12. #define G3D_MAX_PRECISION -1
  13. #define G3D_NO_CACHE 0
  14. #define G3D_USE_CACHE_DEFAULT -1
  15. #define G3D_USE_CACHE_X -2
  16. #define G3D_USE_CACHE_Y -3
  17. #define G3D_USE_CACHE_Z -4
  18. #define G3D_USE_CACHE_XY -5
  19. #define G3D_USE_CACHE_XZ -6
  20. #define G3D_USE_CACHE_YZ -7
  21. #define G3D_USE_CACHE_XYZ -8
  22. #define G3D_DEFAULT_WINDOW NULL
  23. #define G3D_DIRECTORY "grid3"
  24. #define G3D_CELL_ELEMENT "cell"
  25. #define G3D_CATS_ELEMENT "cats"
  26. #define G3D_RANGE_ELEMENT "range"
  27. #define G3D_HEADER_ELEMENT "cellhd"
  28. #define G3D_HISTORY_ELEMENT "hist"
  29. #define G3D_COLOR_ELEMENT "color"
  30. #define G3D_COLOR2_DIRECTORY "colr2"
  31. #define G3D_MASK_MAP "G3D_MASK"
  32. #define G3D_WINDOW_ELEMENT "WIND3"
  33. #define G3D_DEFAULT_WINDOW_ELEMENT "DEFAULT_WIND3"
  34. #define G3D_WINDOW_DATABASE "windows3d"
  35. #define G3D_PERMANENT_MAPSET "PERMANENT"
  36. /*---------------------------------------------------------------------------*/
  37. typedef struct
  38. {
  39. double north, south;
  40. double east, west;
  41. double top, bottom;
  42. /* dimension of data in "cells"; rows == #x; cols == #y; depths == #z */
  43. int rows, cols, depths;
  44. double ns_res, ew_res, tb_res;
  45. int proj; /* Projection (see gis.h) */
  46. int zone; /* Projection zone (see gis.h) */
  47. } G3D_Region;
  48. /*---------------------------------------------------------------------------*/
  49. struct G3D_Map;
  50. typedef void resample_fn(struct G3D_Map *, int, int, int, void *, int);
  51. /*---------------------------------------------------------------------------*/
  52. typedef struct G3D_Map
  53. {
  54. char *fileName;
  55. char *tempName;
  56. char *mapset;
  57. /* operation performed on map */
  58. int operation; /* G3D_WRITE_DATA or G3D_READ_DATA */
  59. /* region */
  60. G3D_Region region;
  61. /* window for map */
  62. G3D_Region window;
  63. /* resmapling function used for map. default is nearest neighbor */
  64. resample_fn *resampleFun;
  65. /* units */
  66. char *unit;
  67. /* dimension of a single tile in "cells" */
  68. int tileX, tileY, tileZ;
  69. /* # of tiles in x, y, and z direction */
  70. int nx, ny, nz;
  71. /* data file specific information */
  72. /* file descriptor */
  73. int data_fd; /* file descriptor */
  74. /* type in which data is stored on file */
  75. int type; /* DCELL_TYPE or FCELL_TYPE */
  76. /* data concering the compression */
  77. int precision; /* G3D_MAX_PRECISION or, 0 .. 23 for float,
  78. 0 .. 52 for double */
  79. int compression; /* G3D_NO_COMPRESSION or G3D_USE_COMPRESSION */
  80. int useLzw; /* G3D_USE_LZW or G3D_NO_LZW */
  81. int useRle; /* G3D_USE_RLE or G3D_NO_RLE */
  82. int useXdr; /* G3D_USE_XDR or G3D_NO_XDR */
  83. /* pointer to first tile in file */
  84. int offset;
  85. /* pointer to the first index entry in file */
  86. long indexOffset;
  87. /* sizeof (long) of the system on which the file is/was written */
  88. int indexLongNbytes;
  89. /* max # bytes used in the representation of indices; this is equal to */
  90. /* # bytes used in the representation of "indexOffset" */
  91. int indexNbytesUsed;
  92. /* pointer to the last entry in the file */
  93. int fileEndPtr;
  94. /* indicates if index is stored in file; used for G3D_READ_DATA only */
  95. int hasIndex; /* G3D_HAS_INDEX or G3D_NO_INDEX */
  96. /* information concerning internal storage of data */
  97. /* index specific information */
  98. /* index[i] == the offset of tile "i" in the data file */
  99. long *index;
  100. /* tileLength[i] == # bytes used to store tile "i" */
  101. int *tileLength;
  102. /* tile specific information */
  103. /* type in which data is stored in memory */
  104. int typeIntern; /* DCELL_TYPE or FCELL_TYPE */
  105. /* in non-cache mode the "data" array is used to store one tile */
  106. char *data;
  107. /* index of tile currently stored in "data"; -1 if none */
  108. int currentIndex;
  109. /* cache related variables */
  110. int useCache; /* 1 if cache is used */
  111. void *cache; /* pointer to cache structure */
  112. int cacheFD; /* file discriptor of cache file -- write mode only */
  113. char *cacheFileName; /* filename of cache file -- write mode only */
  114. long cachePosLast; /* position of last entry in cache file -- write */
  115. /* mode only */
  116. /* range info */
  117. struct FPRange range;
  118. /* some constants stored for efficiency */
  119. /* number of bytes required to store a single value of "type" */
  120. int numLengthExtern;
  121. /* number of bytes required to store a single value of "typeIntern" */
  122. int numLengthIntern;
  123. /* see header.c for details */
  124. int clipX, clipY, clipZ;
  125. int tileXY, tileSize;
  126. int nxy, nTiles;
  127. /* mask related information */
  128. int useMask; /* 1 if mask is used; 0 otherwise */
  129. } G3D_Map;
  130. /*---------------------------------------------------------------------------*/
  131. typedef struct
  132. {
  133. char *elts; /* ptr to array of elts */
  134. int nofElts; /* size of "elts" */
  135. int eltSize; /* size of elt in "elts" */
  136. int *names; /* name[i] is the name of elts[i] */
  137. char *locks; /* lock[i] == 1 iff elts[i] is locked
  138. lock[i] == 0 iff elts[i] is unlocked but active
  139. lock[i] == 2 iff elts[i] doesn't contain valid data */
  140. int autoLock; /* 1 if auto locking is turned on */
  141. int nofUnlocked; /* nof tiles which are unlocked */
  142. int minUnlocked; /* min nof elts which have to remain unlocked. min = 1 */
  143. int *next, *prev; /* prev/next pointers for fifo */
  144. int first, last; /* index (into next) of first and last elt in fifo */
  145. /* first == -1 iff fifo is empty */
  146. int (*eltRemoveFun) (); /* callback activated if the contents of an
  147. elt needs to be removed */
  148. void *eltRemoveFunData; /* pointer to user data passed along with
  149. eltRemoveFun */
  150. int (*eltLoadFun) (); /* callback activated to load contents of an elt */
  151. void *eltLoadFunData; /* pointer to user data passed along with
  152. eltLoadFun */
  153. void *hash; /* ptr to hashTable used to relate external names to
  154. internal indices (elts) */
  155. } G3D_cache;
  156. /*---------------------------------------------------------------------------*/
  157. typedef struct
  158. {
  159. int nofNames;
  160. int *index;
  161. char *active;
  162. int lastName;
  163. int lastIndex;
  164. int lastIndexActive;
  165. } G3d_cache_hash;
  166. /*---------------------------------------------------------------------------*/
  167. typedef int write_fn(int, const void *, void *);
  168. typedef int read_fn(int, void *, void *);
  169. /*---------------------------------------------------------------------------*/
  170. /* grass/src/libes/g3d/cache.c */
  171. void G3d_cache_reset(G3D_cache *);
  172. void G3d_cache_dispose(G3D_cache *);
  173. void *G3d_cache_new(int, int, int, write_fn *, void *, read_fn *, void *);
  174. void G3d_cache_set_removeFun(G3D_cache *, write_fn *, void *);
  175. void G3d_cache_set_loadFun(G3D_cache *, read_fn *, void *);
  176. void *G3d_cache_new_read(int, int, int, read_fn *, void *);
  177. int G3d_cache_lock(G3D_cache *, int);
  178. void G3d_cache_lock_intern(G3D_cache *, int);
  179. int G3d_cache_unlock(G3D_cache *, int);
  180. int G3d_cache_unlock_all(G3D_cache *);
  181. int G3d_cache_lock_all(G3D_cache *);
  182. void G3d_cache_autolock_on(G3D_cache *);
  183. void G3d_cache_autolock_off(G3D_cache *);
  184. void G3d_cache_set_minUnlock(G3D_cache *, int);
  185. int G3d_cache_remove_elt(G3D_cache *, int);
  186. int G3d_cache_flush(G3D_cache *, int);
  187. int G3d_cache_remove_all(G3D_cache *);
  188. int G3d_cache_flush_all(G3D_cache *);
  189. void *G3d_cache_elt_ptr(G3D_cache *, int);
  190. int G3d_cache_load(G3D_cache *, int);
  191. int G3d_cache_get_elt(G3D_cache *, int, void *);
  192. int G3d_cache_put_elt(G3D_cache *, int, const void *);
  193. /* grass/src/libes/g3d/cachehash.c */
  194. void G3d_cache_hash_reset(G3d_cache_hash *);
  195. void G3d_cache_hash_dispose(G3d_cache_hash *);
  196. void *G3d_cache_hash_new(int);
  197. void G3d_cache_hash_remove_name(G3d_cache_hash *, int);
  198. void G3d_cache_hash_load_name(G3d_cache_hash *, int, int);
  199. int G3d_cache_hash_name2index(G3d_cache_hash *, int);
  200. /* grass/src/libes/g3d/changeprecision.c */
  201. void G3d_changePrecision(void *, int, const char *);
  202. /* grass/src/libes/g3d/changetype.c */
  203. void G3d_changeType(void *, const char *);
  204. /* grass/src/libes/g3d/filecompare.c */
  205. void G3d_compareFiles(const char *, const char *, const char *, const char *);
  206. /* grass/src/libes/g3d/filename.c */
  207. void G3d_filename(char *, const char *, const char *, const char *);
  208. /* grass/src/libes/g3d/find_grid3.c */
  209. char *G_find_grid3(const char *, const char *);
  210. /* grass/src/libes/g3d/fpcompress.c */
  211. void G_fpcompress_printBinary(char *, int);
  212. void G_fpcompress_dissectXdrDouble(unsigned char *);
  213. int G_fpcompress_writeXdrNums(int, char *, int, int, char *, int, int, int);
  214. int G_fpcompress_writeXdrFloats(int, char *, int, int, char *, int, int);
  215. int G_fpcompress_writeXdrDouble(int, char *, int, int, char *, int, int);
  216. int G_fpcompress_readXdrNums(int, char *, int, int, int, char *, int);
  217. int G_fpcompress_readXdrFloats(int, char *, int, int, int, char *);
  218. int G_fpcompress_readXdrDoubles(int, char *, int, int, int, char *);
  219. /* grass/src/libes/g3d/g3dalloc.c */
  220. void *G3d_malloc(int);
  221. void *G3d_realloc(void *, int);
  222. void G3d_free(void *);
  223. /* grass/src/libes/g3d/g3dcache.c */
  224. int G3d_initCache(G3D_Map *, int);
  225. int G3d_disposeCache(G3D_Map *);
  226. int G3d_flushAllTiles(G3D_Map *);
  227. /* grass/src/libes/g3d/g3dcats.c */
  228. int G3d_writeCats(const char *, struct Categories *);
  229. int G3d_readCats(const char *, const char *, struct Categories *);
  230. /* grass/src/libes/g3d/g3dclose.c */
  231. int G3d_closeCell(G3D_Map *);
  232. /* grass/src/libes/g3d/g3dcolor.c */
  233. int G3d_removeColor(const char *);
  234. int G3d_readColors(const char *, const char *, struct Colors *);
  235. int G3d_writeColors(const char *, const char *, struct Colors *);
  236. /* grass/src/libes/g3d/g3ddefaults.c */
  237. void G3d_setCompressionMode(int, int, int, int);
  238. void G3d_getCompressionMode(int *, int *, int *, int *);
  239. void G3d_setCacheSize(int);
  240. int G3d_getCacheSize(void);
  241. void G3d_setCacheLimit(int);
  242. int G3d_getCacheLimit(void);
  243. void G3d_setFileType(int);
  244. int G3d_getFileType(void);
  245. void G3d_setTileDimension(int, int, int);
  246. void G3d_getTileDimension(int *, int *, int *);
  247. void G3d_setErrorFun(void (*)(const char *));
  248. void G3d_setUnit(const char *);
  249. void G3d_initDefaults(void);
  250. /* grass/src/libes/g3d/g3ddoubleio.c */
  251. int G3d_writeDoubles(int, int, const double *, int);
  252. int G3d_readDoubles(int, int, double *, int);
  253. /* grass/src/libes/g3d/g3derror.c */
  254. void G3d_skipError(const char *);
  255. void G3d_printError(const char *);
  256. void G3d_fatalError(const char *, ...) __attribute__ ((format(printf, 1, 2)))
  257. __attribute__ ((noreturn));
  258. void G3d_fatalError_noargs(const char *) __attribute__ ((noreturn));
  259. void G3d_error(const char *, ...) __attribute__ ((format(printf, 1, 2)));
  260. /* grass/src/libes/g3d/g3dfpxdr.c */
  261. int G3d_isXdrNullNum(const void *, int);
  262. int G3d_isXdrNullFloat(const float *);
  263. int G3d_isXdrNullDouble(const double *);
  264. void G3d_setXdrNullNum(void *, int);
  265. void G3d_setXdrNullDouble(double *);
  266. void G3d_setXdrNullFloat(float *);
  267. int G3d_initFpXdr(G3D_Map *, int);
  268. int G3d_initCopyToXdr(G3D_Map *, int);
  269. int G3d_copyToXdr(const void *, int);
  270. int G3d_initCopyFromXdr(G3D_Map *, int);
  271. int G3d_copyFromXdr(int, void *);
  272. /* grass/src/libes/g3d/g3dhistory.c */
  273. int G3d_writeHistory(const char *, struct History *);
  274. int G3d_readHistory(const char *, const char *, struct History *);
  275. /* grass/src/libes/g3d/g3dintio.c */
  276. int G3d_writeInts(int, int, const int *, int);
  277. int G3d_readInts(int, int, int *, int);
  278. /* grass/src/libes/g3d/g3dkeys.c */
  279. int G3d_keyGetInt(struct Key_Value *, const char *, int *);
  280. int G3d_keyGetDouble(struct Key_Value *, const char *, double *);
  281. int G3d_keyGetString(struct Key_Value *, const char *, char **);
  282. int G3d_keyGetValue(struct Key_Value *, const char *, char *, char *, int,
  283. int, int *);
  284. int G3d_keySetInt(struct Key_Value *, const char *, const int *);
  285. int G3d_keySetDouble(struct Key_Value *, const char *, const double *);
  286. int G3d_keySetString(struct Key_Value *, const char *, char *const *);
  287. int G3d_keySetValue(struct Key_Value *, const char *, const char *,
  288. const char *, int, int, const int *);
  289. /* grass/src/libes/g3d/g3dlong.c */
  290. int G3d_longEncode(long *, unsigned char *, int);
  291. void G3d_longDecode(unsigned char *, long *, int, int);
  292. /* grass/src/libes/g3d/g3dmapset.c */
  293. void G3d_makeMapsetMapDirectory(const char *);
  294. /* grass/src/libes/g3d/g3dmask.c */
  295. int G3d_maskClose(void);
  296. int G3d_maskFileExists(void);
  297. int G3d_maskOpenOld(void);
  298. int G3d_maskReopen(int);
  299. int G3d_isMasked(G3D_Map *, int, int, int);
  300. void G3d_maskNum(G3D_Map *, int, int, int, void *, int);
  301. void G3d_maskFloat(G3D_Map *, int, int, int, float *);
  302. void G3d_maskDouble(G3D_Map *, int, int, int, double *);
  303. void G3d_maskTile(G3D_Map *, int, void *, int);
  304. void G3d_maskOn(G3D_Map *);
  305. void G3d_maskOff(G3D_Map *);
  306. int G3d_maskIsOn(G3D_Map *);
  307. int G3d_maskIsOff(G3D_Map *);
  308. const char *G3d_maskFile(void);
  309. int G3d_maskMapExists(void);
  310. /* grass/src/libes/g3d/g3dmisc.c */
  311. int G3d_g3dType2cellType(int);
  312. void G3d_copyFloat2Double(const float *, int, double *, int, int);
  313. void G3d_copyDouble2Float(const double *, int, float *, int, int);
  314. void G3d_copyValues(const void *, int, int, void *, int, int, int);
  315. int G3d_length(int);
  316. int G3d_externLength(int);
  317. /* grass/src/libes/g3d/g3dnull.c */
  318. int G3d_isNullValueNum(const void *, int);
  319. void G3d_setNullValue(void *, int, int);
  320. /* grass/src/libes/g3d/g3dopen2.c */
  321. void *G3d_openNewParam(const char *, int , int, G3D_Region *, int, int, int, int, int, int, int);
  322. /* grass/src/libes/g3d/g3dopen.c */
  323. void *G3d_openCellOldNoHeader(const char *, const char *);
  324. void *G3d_openCellOld(const char *, const char *, G3D_Region *, int, int);
  325. void *G3d_openCellNew(const char *, int, int, G3D_Region *);
  326. /* grass/src/libes/g3d/g3dparam.c */
  327. void G3d_setStandard3dInputParams(void);
  328. int G3d_getStandard3dParams(int *, int *, int *, int *, int *, int *, int *,
  329. int *, int *, int *, int *, int *);
  330. void G3d_setWindowParams(void);
  331. char *G3d_getWindowParams(void);
  332. /* grass/src/libes/g3d/g3drange.c */
  333. void G3d_range_updateFromTile(G3D_Map *, const void *, int, int, int, int,
  334. int, int, int, int);
  335. int G3d_readRange(const char *, const char *, struct FPRange *);
  336. int G3d_range_load(G3D_Map *);
  337. void G3d_range_min_max(G3D_Map *, double *, double *);
  338. int G3d_range_write(G3D_Map *);
  339. int G3d_range_init(G3D_Map *);
  340. /* grass/src/libes/g3d/g3dregion.c */
  341. void G3d_getRegionValue(G3D_Map *, double, double, double, void *, int);
  342. void G3d_adjustRegion(G3D_Region *);
  343. void G3d_regionCopy(G3D_Region *, G3D_Region *);
  344. void G3d_incorporate2dRegion(struct Cell_head *, G3D_Region *);
  345. void G3d_regionFromToCellHead(struct Cell_head *, G3D_Region *);
  346. void G3d_adjustRegionRes(G3D_Region *);
  347. void G3d_extract2dRegion(G3D_Region *, struct Cell_head *);
  348. void G3d_regionToCellHead(G3D_Region *, struct Cell_head *);
  349. int G3d_readRegionMap(const char *, const char *, G3D_Region *);
  350. /* grass/src/libes/g3d/g3dresample.c */
  351. void G3d_nearestNeighbor(G3D_Map *, int, int, int, void *, int);
  352. void G3d_setResamplingFun(G3D_Map *, void (*)());
  353. void G3d_getResamplingFun(G3D_Map *, void (**)());
  354. void G3d_getNearestNeighborFunPtr(void (**)());
  355. /* grass/src/libes/g3d/g3dvolume.c */
  356. void G3d_getVolumeA(void *, double[2][2][2][3], int, int, int, void *, int);
  357. void G3d_getVolume(void *, double, double, double, double, double, double,
  358. double, double, double, double, double, double, int, int,
  359. int, void *, int);
  360. void G3d_getAlignedVolume(void *, double, double, double, double, double,
  361. double, int, int, int, void *, int);
  362. void G3d_makeAlignedVolumeFile(void *, const char *, double, double, double,
  363. double, double, double, int, int, int);
  364. /* grass/src/libes/g3d/g3dwindow.c */
  365. void G3d_getValue(G3D_Map *, int, int, int, void *, int);
  366. float G3d_getFloat(G3D_Map *, int, int, int);
  367. double G3d_getDouble(G3D_Map *, int, int, int);
  368. G3D_Region *G3d_windowPtr(void);
  369. void G3d_setWindow(G3D_Region *);
  370. void G3d_setWindowMap(G3D_Map *, G3D_Region *);
  371. void G3d_getWindow(G3D_Region *);
  372. /* grass/src/libes/g3d/g3dwindowio.c */
  373. void G3d_useWindowParams(void);
  374. int G3d_readWindow(G3D_Region *, const char *);
  375. /* int G3d_writeWindow (G3D_Region *, char *); */
  376. /* grass/src/libes/g3d/getblock.c */
  377. void G3d_getBlockNocache(G3D_Map *, int, int, int, int, int, int, void *,
  378. int);
  379. void G3d_getBlock(G3D_Map *, int, int, int, int, int, int, void *, int);
  380. /* grass/src/libes/g3d/header.c */
  381. int G3d_readHeader(G3D_Map *, int *, int *, double *, double *, double *,
  382. double *, double *, double *, int *, int *, int *,
  383. double *, double *, double *, int *, int *, int *, int *,
  384. int *, int *, int *, int *, int *, int *, int *, char **);
  385. int G3d_writeHeader(G3D_Map *, int, int, double, double, double, double,
  386. double, double, int, int, int, double, double, double,
  387. int, int, int, int, int, int, int, int, int, int, int,
  388. char *);
  389. int G3d_cacheSizeEncode(int, int);
  390. int G3d__computeCacheSize(G3D_Map *, int);
  391. int G3d_fillHeader(G3D_Map *, int, int, int, int, int, int, int, int, int,
  392. int, int, int, int, int, int, int, double, double, double,
  393. double, double, double, int, int, int, double, double,
  394. double, char *);
  395. /* grass/src/libes/g3d/headerinfo.c */
  396. void G3d_getCoordsMap(G3D_Map *, int *, int *, int *);
  397. void G3d_getCoordsMapWindow(G3D_Map *, int *, int *, int *);
  398. void G3d_getNofTilesMap(G3D_Map *, int *, int *, int *);
  399. void G3d_getRegionMap(G3D_Map *, double *, double *, double *, double *,
  400. double *, double *);
  401. void G3d_getWindowMap(G3D_Map *, double *, double *, double *, double *,
  402. double *, double *);
  403. void G3d_getTileDimensionsMap(G3D_Map *, int *, int *, int *);
  404. int G3d_tileTypeMap(G3D_Map *);
  405. int G3d_fileTypeMap(G3D_Map *);
  406. int G3d_tilePrecisionMap(G3D_Map *);
  407. int G3d_tileUseCacheMap(G3D_Map *);
  408. void G3d_printHeader(G3D_Map *);
  409. void G3d_getRegionStructMap(G3D_Map *, G3D_Region *);
  410. /* grass/src/libes/g3d/index.c */
  411. int G3d_flushIndex(G3D_Map *);
  412. int G3d_initIndex(G3D_Map *, int);
  413. /* grass/src/libes/g3d/retile.c */
  414. void G3d_retile(void *, const char *, int, int, int);
  415. /* grass/src/libes/g3d/rle.c */
  416. int G_rle_count_only(char *, int, int);
  417. void G_rle_encode(char *, char *, int, int);
  418. void G_rle_decode(char *, char *, int, int, int *, int *);
  419. /* grass/src/libes/g3d/tilealloc.c */
  420. void *G3d_allocTilesType(G3D_Map *, int, int);
  421. void *G3d_allocTiles(G3D_Map *, int);
  422. void G3d_freeTiles(void *);
  423. /* grass/src/libes/g3d/tileio.c */
  424. void *G3d_getTilePtr(G3D_Map *, int);
  425. int G3d_tileLoad(G3D_Map *, int);
  426. int G3d__removeTile(G3D_Map *, int);
  427. float G3d_getFloatRegion(G3D_Map *, int, int, int);
  428. double G3d_getDoubleRegion(G3D_Map *, int, int, int);
  429. void G3d_getValueRegion(G3D_Map *, int, int, int, void *, int);
  430. /* grass/src/libes/g3d/tilemath.c */
  431. void G3d_tileIndex2tile(G3D_Map *, int, int *, int *, int *);
  432. int G3d_tile2tileIndex(G3D_Map *, int, int, int);
  433. void G3d_tileCoordOrigin(G3D_Map *, int, int, int, int *, int *, int *);
  434. void G3d_tileIndexOrigin(G3D_Map *, int, int *, int *, int *);
  435. void G3d_coord2tileCoord(G3D_Map *, int, int, int, int *, int *, int *, int *,
  436. int *, int *);
  437. void G3d_coord2tileIndex(G3D_Map *, int, int, int, int *, int *);
  438. int G3d_coordInRange(G3D_Map *, int, int, int);
  439. int G3d_tileIndexInRange(G3D_Map *, int);
  440. int G3d_tileInRange(G3D_Map *, int, int, int);
  441. int G3d_computeClippedTileDimensions(G3D_Map *, int, int *, int *, int *,
  442. int *, int *, int *);
  443. int G3d_isValidLocation(G3D_Map *, double, double, double);
  444. void G3d_location2coord(G3D_Map *, double, double, double, int *, int *,
  445. int *);
  446. /* grass/src/libes/g3d/tilenull.c */
  447. void G3d_setNullTileType(G3D_Map *, void *, int);
  448. void G3d_setNullTile(G3D_Map *, void *);
  449. /* grass/src/libes/g3d/tileread.c */
  450. int G3d_readTile(G3D_Map *, int, void *, int);
  451. int G3d_readTileFloat(G3D_Map *, int, void *);
  452. int G3d_readTileDouble(G3D_Map *, int, void *);
  453. int G3d_lockTile(G3D_Map *, int);
  454. int G3d_unlockTile(G3D_Map *, int);
  455. int G3d_unlockAll(G3D_Map *);
  456. void G3d_autolockOn(G3D_Map *);
  457. void G3d_autolockOff(G3D_Map *);
  458. void G3d_minUnlocked(G3D_Map *, int);
  459. int G3d_beginCycle(G3D_Map *);
  460. int G3d_endCycle(G3D_Map *);
  461. /* grass/src/libes/g3d/tilewrite.c */
  462. int G3d_writeTile(G3D_Map *, int, const void *, int);
  463. int G3d_writeTileFloat(G3D_Map *, int, const void *);
  464. int G3d_writeTileDouble(G3D_Map *, int, const void *);
  465. int G3d_flushTile(G3D_Map *, int);
  466. int G3d_flushTileCube(G3D_Map *, int, int, int, int, int, int);
  467. int G3d_flushTilesInCube(G3D_Map *, int, int, int, int, int, int);
  468. int G3d_putFloat(G3D_Map *, int, int, int, float);
  469. int G3d_putDouble(G3D_Map *, int, int, int, double);
  470. int G3d_putValue(G3D_Map *, int, int, int, const void *, int);
  471. /* grass/src/libes/g3d/writeascii.c */
  472. void G3d_writeAscii(void *, const char *);
  473. #endif /* #ifndef GRASS_G3D_H */