raster3d.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. #ifndef GRASS_RASTER3DDEFS_H
  2. #define GRASS_RASTER3DDEFS_H
  3. /* cache.c */
  4. void Rast3d_cache_reset(RASTER3D_cache *);
  5. void Rast3d_cache_dispose(RASTER3D_cache *);
  6. void *Rast3d_cache_new(int, int, int, write_fn *, void *, read_fn *, void *);
  7. void Rast3d_cache_set_remove_fun(RASTER3D_cache *, write_fn *, void *);
  8. void Rast3d_cache_set_load_fun(RASTER3D_cache *, read_fn *, void *);
  9. void *Rast3d_cache_new_read(int, int, int, read_fn *, void *);
  10. int Rast3d_cache_lock(RASTER3D_cache *, int);
  11. void Rast3d_cache_lock_intern(RASTER3D_cache *, int);
  12. int Rast3d_cache_unlock(RASTER3D_cache *, int);
  13. int Rast3d_cache_unlock_all(RASTER3D_cache *);
  14. int Rast3d_cache_lock_all(RASTER3D_cache *);
  15. void Rast3d_cache_autolock_on(RASTER3D_cache *);
  16. void Rast3d_cache_autolock_off(RASTER3D_cache *);
  17. void Rast3d_cache_set_min_unlock(RASTER3D_cache *, int);
  18. int Rast3d_cache_remove_elt(RASTER3D_cache *, int);
  19. int Rast3d_cache_flush(RASTER3D_cache *, int);
  20. int Rast3d_cache_remove_all(RASTER3D_cache *);
  21. int Rast3d_cache_flush_all(RASTER3D_cache *);
  22. void *Rast3d_cache_elt_ptr(RASTER3D_cache *, int);
  23. int Rast3d_cache_load(RASTER3D_cache *, int);
  24. int Rast3d_cache_get_elt(RASTER3D_cache *, int, void *);
  25. int Rast3d_cache_put_elt(RASTER3D_cache *, int, const void *);
  26. /* cachehash.c */
  27. void Rast3d_cache_hash_reset(Rast3d_cache_hash *);
  28. void Rast3d_cache_hash_dispose(Rast3d_cache_hash *);
  29. void *Rast3d_cache_hash_new(int);
  30. void Rast3d_cache_hash_remove_name(Rast3d_cache_hash *, int);
  31. void Rast3d_cache_hash_load_name(Rast3d_cache_hash *, int, int);
  32. int Rast3d_cache_hash_name2index(Rast3d_cache_hash *, int);
  33. /* changeprecision.c */
  34. void Rast3d_change_precision(void *, int, const char *);
  35. /* changetype.c */
  36. void Rast3d_change_type(void *, const char *);
  37. /* filecompare.c */
  38. void Rast3d_compare_files(const char *, const char *, const char *, const char *);
  39. /* filename.c */
  40. void Rast3d_filename(char *, const char *, const char *, const char *);
  41. /* fpcompress.c */
  42. void Rast3d_fpcompress_print_binary(char *, int);
  43. void Rast3d_fpcompress_dissect_xdr_double(unsigned char *);
  44. int Rast3d_fpcompress_write_xdr_nums(int, char *, int, int, char *, int);
  45. int Rast3d_fpcompress_read_xdr_nums(int, char *, int, int, int, char *, int);
  46. /* alloc.c */
  47. void *Rast3d_malloc(int);
  48. void *Rast3d_realloc(void *, int);
  49. void Rast3d_free(void *);
  50. /* cache.c */
  51. int Rast3d_init_cache(RASTER3D_Map *, int);
  52. int Rast3d_dispose_cache(RASTER3D_Map *);
  53. int Rast3d_flush_all_tiles(RASTER3D_Map *);
  54. /* cats.c */
  55. int Rast3d_write_cats(const char *, struct Categories *);
  56. int Rast3d_read_cats(const char *, const char *, struct Categories *);
  57. /* close.c */
  58. int Rast3d_close(RASTER3D_Map *);
  59. /* color.c */
  60. int Rast3d_remove_color(const char *);
  61. int Rast3d_read_colors(const char *, const char *, struct Colors *);
  62. int Rast3d_write_colors(const char *, const char *, struct Colors *);
  63. /* defaults.c */
  64. void Rast3d_set_compression_mode(int, int);
  65. void Rast3d_get_compression_mode(int *, int *);
  66. void Rast3d_set_cache_size(int);
  67. int Rast3d_get_cache_size(void);
  68. void Rast3d_set_cache_limit(int);
  69. int Rast3d_get_cache_limit(void);
  70. void Rast3d_set_file_type(int);
  71. int Rast3d_get_file_type(void);
  72. void Rast3d_set_tile_dimension(int, int, int);
  73. void Rast3d_get_tile_dimension(int *, int *, int *);
  74. void Rast3d_set_error_fun(void (*)(const char *));
  75. void Rast3d_init_defaults(void);
  76. /* doubleio.c */
  77. int Rast3d_write_doubles(int, int, const double *, int);
  78. int Rast3d_read_doubles(int, int, double *, int);
  79. /* error.c */
  80. void Rast3d_skip_error(const char *);
  81. void Rast3d_print_error(const char *);
  82. void Rast3d_fatal_error(const char *, ...) __attribute__ ((format(printf, 1, 2)))
  83. __attribute__ ((noreturn));
  84. void Rast3d_fatal_error_noargs(const char *) __attribute__ ((noreturn));
  85. void Rast3d_error(const char *, ...) __attribute__ ((format(printf, 1, 2)));
  86. /* fpxdr.c */
  87. int Rast3d_is_xdr_null_num(const void *, int);
  88. int Rast3d_is_xdr_null_float(const float *);
  89. int Rast3d_is_xdr_null_double(const double *);
  90. void Rast3d_set_xdr_null_num(void *, int);
  91. void Rast3d_set_xdr_null_double(double *);
  92. void Rast3d_set_xdr_null_float(float *);
  93. int Rast3d_init_fp_xdr(RASTER3D_Map *, int);
  94. int Rast3d_init_copy_to_xdr(RASTER3D_Map *, int);
  95. int Rast3d_copy_to_xdr(const void *, int);
  96. int Rast3d_init_copy_from_xdr(RASTER3D_Map *, int);
  97. int Rast3d_copy_from_xdr(int, void *);
  98. /* gradient.c */
  99. void Rast3d_gradient_double(RASTER3D_Array_double *, double *,
  100. RASTER3D_Array_double *, RASTER3D_Array_double *,
  101. RASTER3D_Array_double *);
  102. /* history.c */
  103. int Rast3d_write_history(const char *, struct History *);
  104. int Rast3d_read_history(const char *, const char *, struct History *);
  105. /* intio.c */
  106. int Rast3d_write_ints(int, int, const int *, int);
  107. int Rast3d_read_ints(int, int, int *, int);
  108. /* keys.c */
  109. int Rast3d_key_get_int(struct Key_Value *, const char *, int *);
  110. int Rast3d_key_get_double(struct Key_Value *, const char *, double *);
  111. int Rast3d_key_get_string(struct Key_Value *, const char *, char **);
  112. int Rast3d_key_get_value(struct Key_Value *, const char *, char *, char *, int,
  113. int, int *);
  114. int Rast3d_key_set_int(struct Key_Value *, const char *, const int *);
  115. int Rast3d_key_set_double(struct Key_Value *, const char *, const double *);
  116. int Rast3d_key_set_string(struct Key_Value *, const char *, char *const *);
  117. int Rast3d_key_set_value(struct Key_Value *, const char *, const char *,
  118. const char *, int, int, const int *);
  119. /* long.c */
  120. int Rast3d_long_encode(long *, unsigned char *, int);
  121. void Rast3d_long_decode(unsigned char *, long *, int, int);
  122. /* mapset.c */
  123. void Rast3d_make_mapset_map_directory(const char *);
  124. /* mask.c */
  125. int Rast3d_mask_close(void);
  126. int Rast3d_mask_file_exists(void);
  127. int Rast3d_mask_open_old(void);
  128. int Rast3d_mask_reopen(int);
  129. int Rast3d_is_masked(RASTER3D_Map *, int, int, int);
  130. void Rast3d_mask_num(RASTER3D_Map *, int, int, int, void *, int);
  131. void Rast3d_mask_float(RASTER3D_Map *, int, int, int, float *);
  132. void Rast3d_mask_double(RASTER3D_Map *, int, int, int, double *);
  133. void Rast3d_mask_tile(RASTER3D_Map *, int, void *, int);
  134. void Rast3d_mask_on(RASTER3D_Map *);
  135. void Rast3d_mask_off(RASTER3D_Map *);
  136. int Rast3d_mask_is_on(RASTER3D_Map *);
  137. int Rast3d_mask_is_off(RASTER3D_Map *);
  138. const char *Rast3d_mask_file(void);
  139. int Rast3d_mask_map_exists(void);
  140. /* maskfn.c */
  141. int Rast3d_mask_d_select(DCELL *, d_Mask *);
  142. DCELL Rast3d_mask_match_d_interval(DCELL, d_Interval *);
  143. void Rast3d_parse_vallist(char **, d_Mask **);
  144. /* misc.c */
  145. int Rast3d_g3d_type2cell_type(int);
  146. void Rast3d_copy_float2Double(const float *, int, double *, int, int);
  147. void Rast3d_copy_double2Float(const double *, int, float *, int, int);
  148. void Rast3d_copy_values(const void *, int, int, void *, int, int, int);
  149. int Rast3d_length(int);
  150. int Rast3d_extern_length(int);
  151. /* null.c */
  152. int Rast3d_is_null_value_num(const void *, int);
  153. void Rast3d_set_null_value(void *, int, int);
  154. /* open2.c */
  155. void *Rast3d_open_new_param(const char *, int , int, RASTER3D_Region *, int, int, int, int, int, int);
  156. /* open.c */
  157. void *Rast3d_open_cell_old_no_header(const char *, const char *);
  158. void *Rast3d_open_cell_old(const char *, const char *, RASTER3D_Region *, int, int);
  159. void *Rast3d_open_cell_new(const char *, int, int, RASTER3D_Region *);
  160. void *Rast3d_open_new_opt_tile_size(const char *, int , RASTER3D_Region * , int , int );
  161. /* param.c */
  162. void Rast3d_set_standard3d_input_params(void);
  163. int Rast3d_get_standard3d_params(int *, int *, int *, int *, int *,
  164. int *, int *, int *, int *, int *);
  165. void Rast3d_set_window_params(void);
  166. char *Rast3d_get_window_params(void);
  167. /* range.c */
  168. void Rast3d_range_update_from_tile(RASTER3D_Map *, const void *, int, int, int, int,
  169. int, int, int, int);
  170. int Rast3d_read_range(const char *, const char *, struct FPRange *);
  171. int Rast3d_range_load(RASTER3D_Map *);
  172. void Rast3d_range_min_max(RASTER3D_Map *, double *, double *);
  173. int Rast3d_range_write(RASTER3D_Map *);
  174. int Rast3d_range_init(RASTER3D_Map *);
  175. /* region.c */
  176. void Rast3d_get_region_value(RASTER3D_Map *, double, double, double, void *, int);
  177. void Rast3d_adjust_region(RASTER3D_Region *);
  178. void Rast3d_region_copy(RASTER3D_Region *, RASTER3D_Region *);
  179. void Rast3d_incorporate2d_region(struct Cell_head *, RASTER3D_Region *);
  180. void Rast3d_region_from_to_cell_head(struct Cell_head *, RASTER3D_Region *);
  181. void Rast3d_adjust_region_res(RASTER3D_Region *);
  182. void Rast3d_extract2d_region(RASTER3D_Region *, struct Cell_head *);
  183. void Rast3d_region_to_cell_head(RASTER3D_Region *, struct Cell_head *);
  184. int Rast3d_read_region_map(const char *, const char *, RASTER3D_Region *);
  185. int Rast3d_is_valid_location(RASTER3D_Region *, double, double, double);
  186. void Rast3d_location2coord(RASTER3D_Region *, double, double, double, int *, int *, int *);
  187. void Rast3d_location2coord_double(RASTER3D_Region *, double, double, double, double *, double *, double *);
  188. void Rast3d_location2coord2(RASTER3D_Region *, double, double, double, int *, int *, int *);
  189. void Rast3d_coord2location(RASTER3D_Region *, double, double, double, double *, double *, double *);
  190. /* resample.c */
  191. void Rast3d_nearest_neighbor(RASTER3D_Map *, int, int, int, void *, int);
  192. void Rast3d_set_resampling_fun(RASTER3D_Map *, void (*)());
  193. void Rast3d_get_resampling_fun(RASTER3D_Map *, void (**)());
  194. void Rast3d_get_nearest_neighbor_fun_ptr(void (**)());
  195. /* volume.c */
  196. void Rast3d_get_volume_a(void *, double[2][2][2][3], int, int, int, void *, int);
  197. void Rast3d_get_volume(void *, double, double, double, double, double, double,
  198. double, double, double, double, double, double, int, int,
  199. int, void *, int);
  200. void Rast3d_get_aligned_volume(void *, double, double, double, double, double,
  201. double, int, int, int, void *, int);
  202. void Rast3d_make_aligned_volume_file(void *, const char *, double, double, double,
  203. double, double, double, int, int, int);
  204. /* window.c */
  205. void Rast3d_get_value(RASTER3D_Map *, int, int, int, void *, int);
  206. float Rast3d_get_float(RASTER3D_Map *, int, int, int);
  207. double Rast3d_get_double(RASTER3D_Map *, int, int, int);
  208. void Rast3d_get_window_value(RASTER3D_Map *, double, double, double, void *, int);
  209. RASTER3D_Region *Rast3d_window_ptr(void);
  210. void Rast3d_set_window(RASTER3D_Region *);
  211. void Rast3d_set_window_map(RASTER3D_Map *, RASTER3D_Region *);
  212. void Rast3d_get_window(RASTER3D_Region *);
  213. /* windowio.c */
  214. void Rast3d_use_window_params(void);
  215. int Rast3d_read_window(RASTER3D_Region *, const char *);
  216. /* int Rast3d_writeWindow (RASTER3D_Region *, char *); */
  217. /* getblock.c */
  218. void Rast3d_get_block_nocache(RASTER3D_Map *, int, int, int, int, int, int, void *,
  219. int);
  220. void Rast3d_get_block(RASTER3D_Map *, int, int, int, int, int, int, void *, int);
  221. /* header.c */
  222. int Rast3d_read_header(RASTER3D_Map *, int *, int *, double *, double *, double *,
  223. double *, double *, double *, int *, int *, int *,
  224. double *, double *, double *, int *, int *, int *, int *,
  225. int *, int *, int *, int *, int *, int *, int *, char **, int *, int *);
  226. int Rast3d_write_header(RASTER3D_Map *, int, int, double, double, double, double,
  227. double, double, int, int, int, double, double, double,
  228. int, int, int, int, int, int, int, int, int, int, int,
  229. char *, int, int);
  230. int Rast3d_rewrite_header(RASTER3D_Map * map);
  231. int Rast3d_cache_size_encode(int, int);
  232. int Rast3d__compute_cache_size(RASTER3D_Map *, int);
  233. int Rast3d_fill_header(RASTER3D_Map *, int, int, int, int, int, int, int, int, int,
  234. int, int, int, int, int, int, int, double, double, double,
  235. double, double, double, int, int, int, double, double,
  236. double, char *, int, int);
  237. /* headerinfo.c */
  238. void Rast3d_get_coords_map(RASTER3D_Map *, int *, int *, int *);
  239. void Rast3d_get_coords_map_window(RASTER3D_Map *, int *, int *, int *);
  240. void Rast3d_get_nof_tiles_map(RASTER3D_Map *, int *, int *, int *);
  241. void Rast3d_get_region_map(RASTER3D_Map *, double *, double *, double *, double *,
  242. double *, double *);
  243. void Rast3d_get_window_map(RASTER3D_Map *, double *, double *, double *, double *,
  244. double *, double *);
  245. void Rast3d_get_tile_dimensions_map(RASTER3D_Map *, int *, int *, int *);
  246. int Rast3d_tile_type_map(RASTER3D_Map *);
  247. int Rast3d_file_type_map(RASTER3D_Map *);
  248. int Rast3d_tile_precision_map(RASTER3D_Map *);
  249. int Rast3d_tile_use_cache_map(RASTER3D_Map *);
  250. void Rast3d_print_header(RASTER3D_Map *);
  251. void Rast3d_get_region_struct_map(RASTER3D_Map *, RASTER3D_Region *);
  252. const char* Rast3d_get_unit(RASTER3D_Map * map);
  253. int Rast3d_get_vertical_unit2(RASTER3D_Map * map);
  254. const char* Rast3d_get_vertical_unit(RASTER3D_Map * map);
  255. void Rast3d_set_unit(RASTER3D_Map * map, const char *);
  256. void Rast3d_set_vertical_unit(RASTER3D_Map * map, const char *);
  257. void Rast3d_set_vertical_unit2(RASTER3D_Map * map, int);
  258. /* index.c */
  259. int Rast3d_flush_index(RASTER3D_Map *);
  260. int Rast3d_init_index(RASTER3D_Map *, int);
  261. /* retile.c */
  262. void Rast3d_retile(void *, const char *, int, int, int);
  263. /* rle.c */
  264. int Rast3d_rle_count_only(char *, int, int);
  265. void Rast3d_rle_encode(char *, char *, int, int);
  266. void Rast3d_rle_decode(char *, char *, int, int, int *, int *);
  267. /* tilealloc.c */
  268. void *Rast3d_alloc_tiles_type(RASTER3D_Map *, int, int);
  269. void *Rast3d_alloc_tiles(RASTER3D_Map *, int);
  270. void Rast3d_free_tiles(void *);
  271. /* tileio.c */
  272. void *Rast3d_get_tile_ptr(RASTER3D_Map *, int);
  273. int Rast3d_tile_load(RASTER3D_Map *, int);
  274. int Rast3d__remove_tile(RASTER3D_Map *, int);
  275. float Rast3d_get_float_region(RASTER3D_Map *, int, int, int);
  276. double Rast3d_get_double_region(RASTER3D_Map *, int, int, int);
  277. void Rast3d_get_value_region(RASTER3D_Map *, int, int, int, void *, int);
  278. /* tilemath.c */
  279. void Rast3d_compute_optimal_tile_dimension(RASTER3D_Region *, int, int *, int *, int *, int);
  280. void Rast3d_tile_index2tile(RASTER3D_Map *, int, int *, int *, int *);
  281. int Rast3d_tile2tile_index(RASTER3D_Map *, int, int, int);
  282. void Rast3d_tile_coord_origin(RASTER3D_Map *, int, int, int, int *, int *, int *);
  283. void Rast3d_tile_index_origin(RASTER3D_Map *, int, int *, int *, int *);
  284. void Rast3d_coord2tile_coord(RASTER3D_Map *, int, int, int, int *, int *, int *, int *,
  285. int *, int *);
  286. void Rast3d_coord2tile_index(RASTER3D_Map *, int, int, int, int *, int *);
  287. int Rast3d_coord_in_range(RASTER3D_Map *, int, int, int);
  288. int Rast3d_tile_index_in_range(RASTER3D_Map *, int);
  289. int Rast3d_tile_in_range(RASTER3D_Map *, int, int, int);
  290. int Rast3d_compute_clipped_tile_dimensions(RASTER3D_Map *, int, int *, int *, int *,
  291. int *, int *, int *);
  292. /* tilenull.c */
  293. void Rast3d_set_null_tile_type(RASTER3D_Map *, void *, int);
  294. void Rast3d_set_null_tile(RASTER3D_Map *, void *);
  295. /* tileread.c */
  296. int Rast3d_read_tile(RASTER3D_Map *, int, void *, int);
  297. int Rast3d_read_tile_float(RASTER3D_Map *, int, void *);
  298. int Rast3d_read_tile_double(RASTER3D_Map *, int, void *);
  299. int Rast3d_lock_tile(RASTER3D_Map *, int);
  300. int Rast3d_unlock_tile(RASTER3D_Map *, int);
  301. int Rast3d_unlock_all(RASTER3D_Map *);
  302. void Rast3d_autolock_on(RASTER3D_Map *);
  303. void Rast3d_autolock_off(RASTER3D_Map *);
  304. void Rast3d_min_unlocked(RASTER3D_Map *, int);
  305. int Rast3d_begin_cycle(RASTER3D_Map *);
  306. int Rast3d_end_cycle(RASTER3D_Map *);
  307. /* tilewrite.c */
  308. int Rast3d_write_tile(RASTER3D_Map *, int, const void *, int);
  309. int Rast3d_write_tile_float(RASTER3D_Map *, int, const void *);
  310. int Rast3d_write_tile_double(RASTER3D_Map *, int, const void *);
  311. int Rast3d_flush_tile(RASTER3D_Map *, int);
  312. int Rast3d_flush_tile_cube(RASTER3D_Map *, int, int, int, int, int, int);
  313. int Rast3d_flush_tiles_in_cube(RASTER3D_Map *, int, int, int, int, int, int);
  314. int Rast3d_put_float(RASTER3D_Map *, int, int, int, float);
  315. int Rast3d_put_double(RASTER3D_Map *, int, int, int, double);
  316. int Rast3d_put_value(RASTER3D_Map *, int, int, int, const void *, int);
  317. /* writeascii.c */
  318. void Rast3d_write_ascii(void *, const char *);
  319. #endif /* RASTER3DDEFS */