raster.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. #ifndef GRASS_RASTERDEFS_H
  2. #define GRASS_RASTERDEFS_H
  3. #include <grass/gis.h>
  4. /* --- ANSI prototypes for the lib/raster functions --- */
  5. /* align_window.c */
  6. void Rast_align_window(struct Cell_head *, const struct Cell_head *);
  7. /* alloc_cell.c */
  8. size_t Rast_cell_size(RASTER_MAP_TYPE);
  9. void *Rast_allocate_buf(RASTER_MAP_TYPE);
  10. CELL *Rast_allocate_c_buf(void);
  11. FCELL *Rast_allocate_f_buf(void);
  12. DCELL *Rast_allocate_d_buf(void);
  13. char *Rast_allocate_null_buf(void);
  14. unsigned char *Rast__allocate_null_bits(int);
  15. int Rast__null_bitstream_size(int);
  16. void *Rast_allocate_input_buf(RASTER_MAP_TYPE);
  17. CELL *Rast_allocate_c_input_buf(void);
  18. FCELL *Rast_allocate_f_input_buf(void);
  19. DCELL *Rast_allocate_d_input_buf(void);
  20. char *Rast_allocate_null_input_buf(void);
  21. void *Rast_allocate_output_buf(RASTER_MAP_TYPE);
  22. CELL *Rast_allocate_c_output_buf(void);
  23. FCELL *Rast_allocate_f_output_buf(void);
  24. DCELL *Rast_allocate_d_output_buf(void);
  25. char *Rast_allocate_null_output_buf(void);
  26. /* auto_mask.c */
  27. int Rast__check_for_auto_masking(void);
  28. void Rast_suppress_masking(void);
  29. void Rast_unsuppress_masking(void);
  30. /* cats.c */
  31. int Rast_read_cats(const char *, const char *, struct Categories *);
  32. int Rast_read_vector_cats(const char *, const char *, struct Categories *);
  33. CELL Rast_get_max_c_cat(const char *, const char *);
  34. char *Rast_get_cats_title(const struct Categories *);
  35. char *Rast_get_c_cat(CELL *, struct Categories *);
  36. char *Rast_get_f_cat(FCELL *, struct Categories *);
  37. char *Rast_get_d_cat(DCELL *, struct Categories *);
  38. char *Rast_get_cat(void *, struct Categories *, RASTER_MAP_TYPE);
  39. void Rast_unmark_cats(struct Categories *);
  40. void Rast_mark_c_cats(const CELL *, int, struct Categories *);
  41. void Rast_mark_f_cats(const FCELL *, int, struct Categories *);
  42. void Rast_mark_d_cats(const DCELL *, int, struct Categories *);
  43. int Rast_mark_cats(const void *, int, struct Categories *, RASTER_MAP_TYPE);
  44. void Rast_rewind_cats(struct Categories *);
  45. char *Rast_get_next_marked_d_cat(struct Categories *, DCELL *, DCELL *,
  46. long *);
  47. char *Rast_get_next_marked_c_cat(struct Categories *, CELL *, CELL *,
  48. long *);
  49. char *Rast_get_next_marked_f_cat(struct Categories *, FCELL *, FCELL *,
  50. long *);
  51. char *Rast_get_next_marked_cat(struct Categories *, void *, void *,
  52. long *, RASTER_MAP_TYPE);
  53. int Rast_set_c_cat(const CELL *, const CELL *, const char *, struct Categories *);
  54. int Rast_set_f_cat(const FCELL *, const FCELL *, const char *, struct Categories *);
  55. int Rast_set_d_cat(const DCELL *, const DCELL *, const char *, struct Categories *);
  56. int Rast_set_cat(const void *, const void *, const char *, struct Categories *,
  57. RASTER_MAP_TYPE);
  58. void Rast_write_cats(const char *, struct Categories *);
  59. void Rast_write_vector_cats(const char *, struct Categories *);
  60. char *Rast_get_ith_d_cat(const struct Categories *, int, DCELL *,
  61. DCELL *);
  62. char *Rast_get_ith_f_cat(const struct Categories *, int, void *, void *);
  63. char *Rast_get_ith_c_cat(const struct Categories *, int, void *, void *);
  64. char *Rast_get_ith_cat(const struct Categories *, int, void *, void *,
  65. RASTER_MAP_TYPE);
  66. void Rast_init_cats(const char *, struct Categories *);
  67. void Rast_set_cats_title(const char *, struct Categories *);
  68. void Rast_set_cats_fmt(const char *, double, double, double, double,
  69. struct Categories *);
  70. void Rast_free_cats(struct Categories *);
  71. void Rast_copy_cats(struct Categories *, const struct Categories *);
  72. int Rast_number_of_cats(struct Categories *);
  73. int Rast_sort_cats(struct Categories *);
  74. /* cell_stats.c */
  75. void Rast_init_cell_stats(struct Cell_stats *);
  76. int Rast_update_cell_stats(const CELL *, int, struct Cell_stats *);
  77. int Rast_find_cell_stat(CELL, long *, const struct Cell_stats *);
  78. int Rast_rewind_cell_stats(struct Cell_stats *);
  79. int Rast_next_cell_stat(CELL *, long *, struct Cell_stats *);
  80. void Rast_get_stats_for_null_value(long *, const struct Cell_stats *);
  81. void Rast_free_cell_stats(struct Cell_stats *);
  82. /* cell_title.c */
  83. char *Rast_get_cell_title(const char *, const char *);
  84. /* cellstats_eq.c */
  85. int Rast_cell_stats_histo_eq(struct Cell_stats *, CELL, CELL, CELL, CELL, int,
  86. void (*)(CELL, CELL, CELL));
  87. /* close.c */
  88. void Rast_close(int);
  89. void Rast_unopen(int);
  90. void Rast__unopen_all(void);
  91. void Rast__close_null(int);
  92. /* color_compat.c */
  93. void Rast_make_ryg_colors(struct Colors *, CELL, CELL);
  94. void Rast_make_ryg_fp_colors(struct Colors *, DCELL, DCELL);
  95. void Rast_make_aspect_colors(struct Colors *, CELL, CELL);
  96. void Rast_make_aspect_fp_colors(struct Colors *, DCELL, DCELL);
  97. void Rast_make_byr_colors(struct Colors *, CELL, CELL);
  98. void Rast_make_byr_fp_colors(struct Colors *, DCELL, DCELL);
  99. void Rast_make_bgyr_colors(struct Colors *, CELL, CELL);
  100. void Rast_make_bgyr_fp_colors(struct Colors *, DCELL, DCELL);
  101. void Rast_make_byg_colors(struct Colors *, CELL, CELL);
  102. void Rast_make_byg_fp_colors(struct Colors *, DCELL, DCELL);
  103. void Rast_make_grey_scale_colors(struct Colors *, CELL, CELL);
  104. void Rast_make_grey_scale_fp_colors(struct Colors *, DCELL, DCELL);
  105. void Rast_make_gyr_colors(struct Colors *, CELL, CELL);
  106. void Rast_make_gyr_fp_colors(struct Colors *, DCELL, DCELL);
  107. void Rast_make_rainbow_colors(struct Colors *, CELL, CELL);
  108. void Rast_make_rainbow_fp_colors(struct Colors *, DCELL, DCELL);
  109. void Rast_make_ramp_colors(struct Colors *, CELL, CELL);
  110. void Rast_make_ramp_fp_colors(struct Colors *, DCELL, DCELL);
  111. void Rast_make_wave_colors(struct Colors *, CELL, CELL);
  112. void Rast_make_wave_fp_colors(struct Colors *, DCELL, DCELL);
  113. /* color_free.c */
  114. void Rast_free_colors(struct Colors *);
  115. void Rast__color_free_rules(struct _Color_Info_ *);
  116. void Rast__color_free_lookup(struct _Color_Info_ *);
  117. void Rast__color_free_fp_lookup(struct _Color_Info_ *);
  118. void Rast__color_reset(struct Colors *);
  119. /* color_get.c */
  120. int Rast_get_color(const void *, int *, int *, int *, struct Colors *,
  121. RASTER_MAP_TYPE);
  122. int Rast_get_c_color(const CELL *, int *, int *, int *, struct Colors *);
  123. int Rast_get_f_color(const FCELL *, int *, int *, int *, struct Colors *);
  124. int Rast_get_d_color(const DCELL *, int *, int *, int *, struct Colors *);
  125. void Rast_get_null_value_color(int *, int *, int *, const struct Colors *);
  126. void Rast_get_default_color(int *, int *, int *, const struct Colors *);
  127. /* color_hist.c */
  128. void Rast_make_histogram_eq_colors(struct Colors *, struct Cell_stats *);
  129. void Rast_make_histogram_log_colors(struct Colors *, struct Cell_stats *, int, int);
  130. /* color_init.c */
  131. void Rast_init_colors(struct Colors *);
  132. /* color_insrt.c */
  133. int Rast__insert_color_into_lookup(CELL, int, int, int, struct _Color_Info_ *);
  134. /* color_invrt.c */
  135. void Rast_invert_colors(struct Colors *);
  136. /* color_look.c */
  137. void Rast_lookup_c_colors(const CELL *, unsigned char *, unsigned char *,
  138. unsigned char *, unsigned char *, int,
  139. struct Colors *);
  140. void Rast_lookup_colors(const void *, unsigned char *, unsigned char *,
  141. unsigned char *, unsigned char *, int,
  142. struct Colors *, RASTER_MAP_TYPE);
  143. void Rast_lookup_f_colors(const FCELL *, unsigned char *, unsigned char *,
  144. unsigned char *, unsigned char *, int,
  145. struct Colors *);
  146. void Rast_lookup_d_colors(const DCELL *, unsigned char *, unsigned char *,
  147. unsigned char *, unsigned char *, int,
  148. struct Colors *);
  149. void Rast__lookup_colors(const void *, unsigned char *, unsigned char *,
  150. unsigned char *, unsigned char *, int, struct Colors *,
  151. int, int, RASTER_MAP_TYPE);
  152. void Rast__interpolate_color_rule(DCELL, unsigned char *, unsigned char *,
  153. unsigned char *, const struct _Color_Rule_ *);
  154. /* color_org.c */
  155. void Rast__organize_colors(struct Colors *);
  156. /* color_out.c */
  157. void Rast_print_colors(struct Colors *, DCELL, DCELL, FILE *, int);
  158. /* color_rand.c */
  159. void Rast_make_random_colors(struct Colors *, CELL, CELL);
  160. /* color_range.c */
  161. void Rast_set_c_color_range(CELL, CELL, struct Colors *);
  162. void Rast_set_d_color_range(DCELL, DCELL, struct Colors *);
  163. void Rast_get_c_color_range(CELL *, CELL *, const struct Colors *);
  164. void Rast_get_d_color_range(DCELL *, DCELL *, const struct Colors *);
  165. /* color_read.c */
  166. int Rast_read_colors(const char *, const char *, struct Colors *);
  167. int Rast__read_colors(const char *, const char *, const char *, struct Colors *);
  168. void Rast_mark_colors_as_fp(struct Colors *);
  169. /* color_remove.c */
  170. int Rast_remove_colors(const char *, const char *);
  171. /* color_rule.c */
  172. void Rast_add_d_color_rule(const DCELL *, int, int, int,
  173. const DCELL *, int, int, int,
  174. struct Colors *);
  175. void Rast_add_f_color_rule(const FCELL *, int, int, int,
  176. const FCELL *, int, int, int,
  177. struct Colors *);
  178. void Rast_add_c_color_rule(const CELL *, int, int, int,
  179. const CELL *, int, int, int,
  180. struct Colors *);
  181. void Rast_add_color_rule(const void *, int, int, int,
  182. const void *, int, int, int,
  183. struct Colors *, RASTER_MAP_TYPE);
  184. int Rast_add_modular_d_color_rule(const DCELL *, int, int, int,
  185. const DCELL *, int, int, int,
  186. struct Colors *);
  187. int Rast_add_modular_f_color_rule(const FCELL *, int, int, int,
  188. const FCELL *, int, int, int,
  189. struct Colors *);
  190. int Rast_add_modular_c_color_rule(const CELL *, int, int, int,
  191. const CELL *, int, int, int,
  192. struct Colors *);
  193. int Rast_add_modular_color_rule(const void *, int, int, int,
  194. const void *, int, int, int,
  195. struct Colors *, RASTER_MAP_TYPE);
  196. /* color_rule_get.c */
  197. int Rast_colors_count(const struct Colors *);
  198. int Rast_get_fp_color_rule(DCELL *, unsigned char *, unsigned char *,
  199. unsigned char *, DCELL *, unsigned char *,
  200. unsigned char *, unsigned char *,
  201. const struct Colors *, int);
  202. /* color_rules.c */
  203. typedef int read_rule_fn(void *, DCELL, DCELL,
  204. DCELL *, int *, int *, int *, int *, int *, int *);
  205. int Rast_parse_color_rule(DCELL, DCELL, const char *, DCELL *, int *, int *,
  206. int *, int *, int *, int *);
  207. const char *Rast_parse_color_rule_error(int);
  208. int Rast_read_color_rule(void *, DCELL, DCELL, DCELL *, int *, int *, int *,
  209. int *, int *, int *);
  210. int Rast_read_color_rules(struct Colors *, DCELL, DCELL, read_rule_fn *, void *);
  211. int Rast_load_colors(struct Colors *, const char *, CELL, CELL);
  212. int Rast_load_fp_colors(struct Colors *, const char *, DCELL, DCELL);
  213. void Rast_make_colors(struct Colors *, const char *, CELL, CELL);
  214. void Rast_make_fp_colors(struct Colors *, const char *, DCELL, DCELL);
  215. /* color_set.c */
  216. void Rast_set_c_color(CELL, int, int, int, struct Colors *);
  217. void Rast_set_d_color(DCELL, int, int, int, struct Colors *);
  218. void Rast_set_null_value_color(int, int, int, struct Colors *);
  219. void Rast_set_default_color(int, int, int, struct Colors *);
  220. /* color_shift.c */
  221. void Rast_shift_c_colors(CELL, struct Colors *);
  222. void Rast_shift_d_colors(DCELL, struct Colors *);
  223. /* color_write.c */
  224. void Rast_write_colors(const char *, const char *, struct Colors *);
  225. void Rast__write_colors(FILE *, struct Colors *);
  226. /* color_xform.c */
  227. void Rast_histogram_eq_colors(struct Colors *, struct Colors *,
  228. struct Cell_stats *);
  229. void Rast_histogram_eq_fp_colors(struct Colors *,
  230. struct Colors *, struct FP_stats *);
  231. void Rast_log_colors(struct Colors *, struct Colors *, int);
  232. void Rast_abs_log_colors(struct Colors *, struct Colors *, int);
  233. /* format.c */
  234. int Rast__check_format(int);
  235. int Rast__read_row_ptrs(int);
  236. int Rast__read_null_row_ptrs(int, int);
  237. int Rast__write_row_ptrs(int);
  238. int Rast__write_null_row_ptrs(int, int);
  239. /* fpreclass.c */
  240. void Rast_fpreclass_clear(struct FPReclass *);
  241. void Rast_fpreclass_reset(struct FPReclass *);
  242. void Rast_fpreclass_init(struct FPReclass *);
  243. void Rast_fpreclass_set_domain(struct FPReclass *, DCELL, DCELL);
  244. void Rast_fpreclass_set_range(struct FPReclass *, DCELL, DCELL);
  245. int Rast_fpreclass_get_limits(const struct FPReclass *, DCELL *, DCELL *,
  246. DCELL *, DCELL *);
  247. int Rast_fpreclass_nof_rules(const struct FPReclass *);
  248. void Rast_fpreclass_get_ith_rule(const struct FPReclass *, int, DCELL *, DCELL *,
  249. DCELL *, DCELL *);
  250. void Rast_fpreclass_set_neg_infinite_rule(struct FPReclass *, DCELL, DCELL);
  251. int Rast_fpreclass_get_neg_infinite_rule(const struct FPReclass *, DCELL *,
  252. DCELL *);
  253. void Rast_fpreclass_set_pos_infinite_rule(struct FPReclass *, DCELL, DCELL);
  254. int Rast_fpreclass_get_pos_infinite_rule(const struct FPReclass *, DCELL *,
  255. DCELL *);
  256. void Rast_fpreclass_add_rule(struct FPReclass *, DCELL, DCELL, DCELL, DCELL);
  257. void Rast_fpreclass_reverse_rule_order(struct FPReclass *);
  258. DCELL Rast_fpreclass_get_cell_value(const struct FPReclass *, DCELL);
  259. void Rast_fpreclass_perform_di(const struct FPReclass *, const DCELL *, CELL *,
  260. int);
  261. void Rast_fpreclass_perform_df(const struct FPReclass *, const DCELL *, FCELL *,
  262. int);
  263. void Rast_fpreclass_perform_dd(const struct FPReclass *, const DCELL *, DCELL *,
  264. int);
  265. void Rast_fpreclass_perform_fi(const struct FPReclass *, const FCELL *, CELL *,
  266. int);
  267. void Rast_fpreclass_perform_ff(const struct FPReclass *, const FCELL *, FCELL *,
  268. int);
  269. void Rast_fpreclass_perform_fd(const struct FPReclass *, const FCELL *, DCELL *,
  270. int);
  271. void Rast_fpreclass_perform_ii(const struct FPReclass *, const CELL *, CELL *,
  272. int);
  273. void Rast_fpreclass_perform_if(const struct FPReclass *, const CELL *, FCELL *,
  274. int);
  275. void Rast_fpreclass_perform_id(const struct FPReclass *, const CELL *, DCELL *,
  276. int);
  277. /* gdal.c */
  278. void Rast_init_gdal(void);
  279. struct GDAL_link *Rast_get_gdal_link(const char *, const char *);
  280. struct GDAL_link *Rast_create_gdal_link(const char *, RASTER_MAP_TYPE);
  281. void Rast_close_gdal_link(struct GDAL_link *);
  282. int Rast_close_gdal_write_link(struct GDAL_link *);
  283. /* get_cellhd.c */
  284. void Rast_get_cellhd(const char *, const char *, struct Cell_head *);
  285. /* get_row.c */
  286. void Rast_get_row_nomask(int, void *, int, RASTER_MAP_TYPE);
  287. void Rast_get_c_row_nomask(int, CELL *, int);
  288. void Rast_get_f_row_nomask(int, FCELL *, int);
  289. void Rast_get_d_row_nomask(int, DCELL *, int);
  290. void Rast_get_row(int, void *, int, RASTER_MAP_TYPE);
  291. void Rast_get_c_row(int, CELL *, int);
  292. void Rast_get_f_row(int, FCELL *, int);
  293. void Rast_get_d_row(int, DCELL *, int);
  294. void Rast_get_null_value_row(int, char *, int);
  295. int Rast__read_null_bits(int, int, unsigned char *);
  296. /* get_row_colr.c */
  297. void Rast_get_row_colors(int, int, struct Colors *,
  298. unsigned char *, unsigned char *, unsigned char *,
  299. unsigned char *);
  300. /* histo_eq.c */
  301. void Rast_histogram_eq(const struct Histogram *, unsigned char **,
  302. CELL *, CELL *);
  303. /* histogram.c */
  304. void Rast_init_histogram(struct Histogram *);
  305. int Rast_read_histogram(const char *, const char *, struct Histogram *);
  306. void Rast_write_histogram(const char *, const struct Histogram *);
  307. void Rast_write_histogram_cs(const char *, struct Cell_stats *);
  308. void Rast_make_histogram_cs(struct Cell_stats *, struct Histogram *);
  309. int Rast_get_histogram_num(const struct Histogram *);
  310. CELL Rast_get_histogram_cat(int, const struct Histogram *);
  311. long Rast_get_histogram_count(int, const struct Histogram *);
  312. void Rast_free_histogram(struct Histogram *);
  313. int Rast_sort_histogram(struct Histogram *);
  314. int Rast_sort_histogram_by_count(struct Histogram *);
  315. void Rast_remove_histogram(const char *);
  316. int Rast_add_histogram(CELL, long, struct Histogram *);
  317. int Rast_set_histogram(CELL, long, struct Histogram *);
  318. void Rast_extend_histogram(CELL, long, struct Histogram *);
  319. void Rast_zero_histogram(struct Histogram *);
  320. /* history.c */
  321. int Rast__read_history(struct History *, FILE *);
  322. int Rast_read_history(const char *, const char *, struct History *);
  323. void Rast__write_history(struct History *, FILE *);
  324. void Rast_write_history(const char *, struct History *);
  325. void Rast_short_history(const char *, const char *, struct History *);
  326. int Rast_command_history(struct History *);
  327. void Rast_append_history(struct History *, const char *);
  328. void Rast_append_format_history(struct History *, const char *, ...)
  329. __attribute__ ((format(printf, 2, 3)));
  330. const char *Rast_get_history(struct History *, int);
  331. void Rast_set_history(struct History *, int, const char *);
  332. void Rast_format_history(struct History *, int, const char *, ...)
  333. __attribute__ ((format(printf, 3, 4)));
  334. void Rast_clear_history(struct History *);
  335. void Rast_free_history(struct History *);
  336. int Rast_history_length(struct History *);
  337. const char *Rast_history_line(struct History *, int);
  338. /* init.c */
  339. void Rast_init(void);
  340. void Rast__check_init(void);
  341. void Rast_init_all(void);
  342. void Rast__init(void);
  343. void Rast__error_handler(void *);
  344. /* interp.c */
  345. DCELL Rast_interp_linear(double, DCELL, DCELL);
  346. DCELL Rast_interp_bilinear(double, double, DCELL, DCELL, DCELL, DCELL);
  347. DCELL Rast_interp_cubic(double, DCELL, DCELL, DCELL, DCELL);
  348. DCELL Rast_interp_bicubic(double, double,
  349. DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL,
  350. DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL,
  351. DCELL);
  352. DCELL Rast_interp_lanczos(double, double, DCELL *);
  353. DCELL Rast_interp_cubic_bspline(double, DCELL, DCELL, DCELL, DCELL);
  354. DCELL Rast_interp_bicubic_bspline(double, double,
  355. DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL,
  356. DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL,
  357. DCELL);
  358. int Rast_option_to_interp_type(const struct Option *);
  359. /* mask_info.c */
  360. char *Rast_mask_info(void);
  361. int Rast__mask_info(char *, char *);
  362. /* maskfd.c */
  363. int Rast_maskfd(void);
  364. /* null_val.c */
  365. #define Rast_is_c_null_value(cellVal) \
  366. (*(const CELL *)(cellVal) == (CELL) 0x80000000)
  367. #define Rast_is_f_null_value(fcellVal) \
  368. (*(const FCELL *)(fcellVal) != *(const FCELL *)(fcellVal))
  369. #define Rast_is_d_null_value(dcellVal) \
  370. (*(const DCELL *)(dcellVal) != *(const DCELL *)(dcellVal))
  371. void Rast__set_null_value(void *, int, int, RASTER_MAP_TYPE);
  372. void Rast_set_null_value(void *, int, RASTER_MAP_TYPE);
  373. void Rast_set_c_null_value(CELL *, int);
  374. void Rast_set_f_null_value(FCELL *, int);
  375. void Rast_set_d_null_value(DCELL *, int);
  376. int Rast_is_null_value(const void *, RASTER_MAP_TYPE);
  377. #ifndef Rast_is_c_null_value
  378. int Rast_is_c_null_value(const CELL *);
  379. #endif
  380. #ifndef Rast_is_f_null_value
  381. int Rast_is_f_null_value(const FCELL *);
  382. #endif
  383. #ifndef Rast_is_d_null_value
  384. int Rast_is_d_null_value(const DCELL *);
  385. #endif
  386. void Rast_insert_null_values(void *, char *, int, RASTER_MAP_TYPE);
  387. void Rast_insert_c_null_values(CELL *, char *, int);
  388. void Rast_insert_f_null_values(FCELL *, char *, int);
  389. void Rast_insert_d_null_values(DCELL *, char *, int);
  390. int Rast__check_null_bit(const unsigned char *, int, int);
  391. void Rast__convert_01_flags(const char *, unsigned char *, int);
  392. void Rast__convert_flags_01(char *, const unsigned char *, int);
  393. void Rast__init_null_bits(unsigned char *, int);
  394. /* open.c */
  395. int Rast_open_old(const char *, const char *);
  396. int Rast__open_old(const char *, const char *);
  397. int Rast_open_c_new(const char *);
  398. int Rast_open_c_new_uncompressed(const char *);
  399. void Rast_want_histogram(int);
  400. void Rast_set_cell_format(int);
  401. int Rast_get_cell_format(CELL);
  402. int Rast_open_fp_new(const char *);
  403. int Rast_open_fp_new_uncompressed(const char *);
  404. void Rast_set_fp_type(RASTER_MAP_TYPE);
  405. int Rast_map_is_fp(const char *, const char *);
  406. RASTER_MAP_TYPE Rast_map_type(const char *, const char *);
  407. RASTER_MAP_TYPE Rast__check_fp_type(const char *, const char *);
  408. RASTER_MAP_TYPE Rast_get_map_type(int);
  409. int Rast_open_new(const char *, RASTER_MAP_TYPE);
  410. int Rast_open_new_uncompressed(const char *, RASTER_MAP_TYPE);
  411. void Rast_set_quant_rules(int, struct Quant *);
  412. int Rast__open_null_write(const char *);
  413. /* put_cellhd.c */
  414. void Rast_put_cellhd(const char *, struct Cell_head *);
  415. /* put_row.c */
  416. void Rast_put_row(int, const void *, RASTER_MAP_TYPE);
  417. void Rast_put_c_row(int, const CELL *);
  418. void Rast_put_f_row(int, const FCELL *);
  419. void Rast_put_d_row(int, const DCELL *);
  420. void Rast__write_null_bits(int, const unsigned char *);
  421. /* put_title.c */
  422. int Rast_put_cell_title(const char *, const char *);
  423. /* quant.c */
  424. void Rast_quant_clear(struct Quant *);
  425. void Rast_quant_free(struct Quant *);
  426. int Rast__quant_organize_fp_lookup(struct Quant *);
  427. void Rast_quant_init(struct Quant *);
  428. int Rast_quant_is_truncate(const struct Quant *);
  429. int Rast_quant_is_round(const struct Quant *);
  430. void Rast_quant_truncate(struct Quant *);
  431. void Rast_quant_round(struct Quant *);
  432. int Rast_quant_get_limits(const struct Quant *, DCELL *, DCELL *, CELL *,
  433. CELL *);
  434. int Rast_quant_nof_rules(const struct Quant *);
  435. void Rast_quant_get_ith_rule(const struct Quant *, int, DCELL *, DCELL *, CELL *,
  436. CELL *);
  437. void Rast_quant_set_neg_infinite_rule(struct Quant *, DCELL, CELL);
  438. int Rast_quant_get_neg_infinite_rule(const struct Quant *, DCELL *, CELL *);
  439. void Rast_quant_set_pos_infinite_rule(struct Quant *, DCELL, CELL);
  440. int Rast_quant_get_pos_infinite_rule(const struct Quant *, DCELL *, CELL *);
  441. void Rast_quant_add_rule(struct Quant *, DCELL, DCELL, CELL, CELL);
  442. void Rast_quant_reverse_rule_order(struct Quant *);
  443. CELL Rast_quant_get_cell_value(struct Quant *, DCELL);
  444. void Rast_quant_perform_d(struct Quant *, const DCELL *, CELL *, int);
  445. void Rast_quant_perform_f(struct Quant *, const FCELL *, CELL *, int);
  446. struct Quant_table *Rast__quant_get_rule_for_d_raster_val(const struct Quant *,
  447. DCELL);
  448. /* quant_io.c */
  449. int Rast__quant_import(const char *, const char *, struct Quant *);
  450. int Rast__quant_export(const char *, const char *, const struct Quant *);
  451. /* quant_rw.c */
  452. void Rast_truncate_fp_map(const char *, const char *);
  453. void Rast_round_fp_map(const char *, const char *);
  454. void Rast_quantize_fp_map(const char *, const char *, CELL, CELL);
  455. void Rast_quantize_fp_map_range(const char *, const char *, DCELL, DCELL, CELL,
  456. CELL);
  457. void Rast_write_quant(const char *, const char *, const struct Quant *);
  458. int Rast_read_quant(const char *, const char *, struct Quant *);
  459. /* range.c */
  460. void Rast__remove_fp_range(const char *);
  461. void Rast_construct_default_range(struct Range *);
  462. int Rast_read_fp_range(const char *, const char *, struct FPRange *);
  463. int Rast_read_range(const char *, const char *, struct Range *);
  464. void Rast_write_range(const char *, const struct Range *);
  465. void Rast_write_fp_range(const char *, const struct FPRange *);
  466. void Rast_update_range(CELL, struct Range *);
  467. void Rast_update_fp_range(DCELL, struct FPRange *);
  468. void Rast_row_update_range(const CELL *, int, struct Range *);
  469. void Rast__row_update_range(const CELL *, int, struct Range *, int);
  470. void Rast_row_update_fp_range(const void *, int, struct FPRange *,
  471. RASTER_MAP_TYPE);
  472. void Rast_init_range(struct Range *);
  473. void Rast_get_range_min_max(const struct Range *, CELL *, CELL *);
  474. void Rast_init_fp_range(struct FPRange *);
  475. void Rast_get_fp_range_min_max(const struct FPRange *, DCELL *, DCELL *);
  476. int Rast_read_rstats(const char *, const char *, struct R_stats *);
  477. void Rast_write_rstats(const char *, const struct R_stats *);
  478. /* raster.c */
  479. int Rast_raster_cmp(const void *, const void *, RASTER_MAP_TYPE);
  480. void Rast_raster_cpy(void *, const void *, int, RASTER_MAP_TYPE);
  481. void Rast_set_c_value(void *, CELL, RASTER_MAP_TYPE);
  482. void Rast_set_f_value(void *, FCELL, RASTER_MAP_TYPE);
  483. void Rast_set_d_value(void *, DCELL, RASTER_MAP_TYPE);
  484. CELL Rast_get_c_value(const void *, RASTER_MAP_TYPE);
  485. FCELL Rast_get_f_value(const void *, RASTER_MAP_TYPE);
  486. DCELL Rast_get_d_value(const void *, RASTER_MAP_TYPE);
  487. /* raster_metadata.c */
  488. char *Rast_read_units(const char *, const char *);
  489. char *Rast_read_vdatum(const char *, const char *);
  490. char *Rast_read_semantic_label(const char *, const char *);
  491. char *Rast_get_semantic_label_or_name(const char *, const char *);
  492. void Rast_write_units(const char *, const char *);
  493. void Rast_write_vdatum(const char *, const char *);
  494. void Rast_write_semantic_label(const char *, const char *);
  495. bool Rast_legal_semantic_label(const char *);
  496. /* rast_to_img_string.c */
  497. int Rast_map_to_img_str(char *, int, unsigned char*);
  498. /* reclass.c */
  499. int Rast_is_reclass(const char *, const char *, char *, char *);
  500. int Rast_is_reclassed_to(const char *, const char *, int *, char ***);
  501. int Rast_get_reclass(const char *, const char *, struct Reclass *);
  502. void Rast_free_reclass(struct Reclass *);
  503. int Rast_put_reclass(const char *, const struct Reclass *);
  504. /* sample.c */
  505. DCELL Rast_get_sample_nearest(int, const struct Cell_head *, struct Categories *, double, double, int);
  506. DCELL Rast_get_sample_bilinear(int, const struct Cell_head *, struct Categories *, double, double, int);
  507. DCELL Rast_get_sample_cubic(int, const struct Cell_head *, struct Categories *, double, double, int);
  508. DCELL Rast_get_sample(int, const struct Cell_head *, struct Categories *, double, double, int, INTERP_TYPE);
  509. /* set_window.c */
  510. void Rast__init_window(void);
  511. void Rast_set_window(struct Cell_head *);
  512. void Rast_unset_window(void);
  513. void Rast_set_output_window(struct Cell_head *);
  514. void Rast_set_input_window(struct Cell_head *);
  515. /* vrt.c */
  516. struct R_vrt *Rast_get_vrt(const char *, const char *);
  517. void Rast_close_vrt(struct R_vrt *);
  518. int Rast_get_vrt_row(int, void *, int, RASTER_MAP_TYPE);
  519. /* window.c */
  520. void Rast_get_window(struct Cell_head *);
  521. void Rast_get_input_window(struct Cell_head *);
  522. void Rast_get_output_window(struct Cell_head *);
  523. int Rast_window_rows(void);
  524. int Rast_window_cols(void);
  525. int Rast_input_window_rows(void);
  526. int Rast_input_window_cols(void);
  527. int Rast_output_window_rows(void);
  528. int Rast_output_window_cols(void);
  529. double Rast_northing_to_row(double, const struct Cell_head *);
  530. double Rast_easting_to_col(double, const struct Cell_head *);
  531. double Rast_row_to_northing(double, const struct Cell_head *);
  532. double Rast_col_to_easting(double, const struct Cell_head *);
  533. /* window_map.c */
  534. void Rast__create_window_mapping(int);
  535. int Rast_row_repeat_nomask(int, int);
  536. /* zero_cell.c */
  537. void Rast_zero_buf(void *, RASTER_MAP_TYPE);
  538. void Rast_zero_input_buf(void *, RASTER_MAP_TYPE);
  539. void Rast_zero_output_buf(void *, RASTER_MAP_TYPE);
  540. #endif /* GRASS_RASTERDEFS_H */