raster.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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. /* color_compat.c */
  92. void Rast_make_ryg_colors(struct Colors *, CELL, CELL);
  93. void Rast_make_ryg_fp_colors(struct Colors *, DCELL, DCELL);
  94. void Rast_make_aspect_colors(struct Colors *, CELL, CELL);
  95. void Rast_make_aspect_fp_colors(struct Colors *, DCELL, DCELL);
  96. void Rast_make_byr_colors(struct Colors *, CELL, CELL);
  97. void Rast_make_byr_fp_colors(struct Colors *, DCELL, DCELL);
  98. void Rast_make_bgyr_colors(struct Colors *, CELL, CELL);
  99. void Rast_make_bgyr_fp_colors(struct Colors *, DCELL, DCELL);
  100. void Rast_make_byg_colors(struct Colors *, CELL, CELL);
  101. void Rast_make_byg_fp_colors(struct Colors *, DCELL, DCELL);
  102. void Rast_make_grey_scale_colors(struct Colors *, CELL, CELL);
  103. void Rast_make_grey_scale_fp_colors(struct Colors *, DCELL, DCELL);
  104. void Rast_make_gyr_colors(struct Colors *, CELL, CELL);
  105. void Rast_make_gyr_fp_colors(struct Colors *, DCELL, DCELL);
  106. void Rast_make_rainbow_colors(struct Colors *, CELL, CELL);
  107. void Rast_make_rainbow_fp_colors(struct Colors *, DCELL, DCELL);
  108. void Rast_make_ramp_colors(struct Colors *, CELL, CELL);
  109. void Rast_make_ramp_fp_colors(struct Colors *, DCELL, DCELL);
  110. void Rast_make_wave_colors(struct Colors *, CELL, CELL);
  111. void Rast_make_wave_fp_colors(struct Colors *, DCELL, DCELL);
  112. /* color_free.c */
  113. void Rast_free_colors(struct Colors *);
  114. void Rast__color_free_rules(struct _Color_Info_ *);
  115. void Rast__color_free_lookup(struct _Color_Info_ *);
  116. void Rast__color_free_fp_lookup(struct _Color_Info_ *);
  117. void Rast__color_reset(struct Colors *);
  118. /* color_get.c */
  119. int Rast_get_color(const void *, int *, int *, int *, struct Colors *,
  120. RASTER_MAP_TYPE);
  121. int Rast_get_c_color(const CELL *, int *, int *, int *, struct Colors *);
  122. int Rast_get_f_color(const FCELL *, int *, int *, int *, struct Colors *);
  123. int Rast_get_d_color(const DCELL *, int *, int *, int *, struct Colors *);
  124. void Rast_get_null_value_color(int *, int *, int *, const struct Colors *);
  125. void Rast_get_default_color(int *, int *, int *, const struct Colors *);
  126. /* color_hist.c */
  127. void Rast_make_histogram_eq_colors(struct Colors *, struct Cell_stats *);
  128. void Rast_make_histogram_log_colors(struct Colors *, struct Cell_stats *, int, int);
  129. /* color_init.c */
  130. void Rast_init_colors(struct Colors *);
  131. /* color_insrt.c */
  132. int Rast__insert_color_into_lookup(CELL, int, int, int, struct _Color_Info_ *);
  133. /* color_invrt.c */
  134. void Rast_invert_colors(struct Colors *);
  135. /* color_look.c */
  136. void Rast_lookup_c_colors(const CELL *, unsigned char *, unsigned char *,
  137. unsigned char *, unsigned char *, int,
  138. struct Colors *);
  139. void Rast_lookup_colors(const void *, unsigned char *, unsigned char *,
  140. unsigned char *, unsigned char *, int,
  141. struct Colors *, RASTER_MAP_TYPE);
  142. void Rast_lookup_f_colors(const FCELL *, unsigned char *, unsigned char *,
  143. unsigned char *, unsigned char *, int,
  144. struct Colors *);
  145. void Rast_lookup_d_colors(const DCELL *, unsigned char *, unsigned char *,
  146. unsigned char *, unsigned char *, int,
  147. struct Colors *);
  148. void Rast__lookup_colors(const void *, unsigned char *, unsigned char *,
  149. unsigned char *, unsigned char *, int, struct Colors *,
  150. int, int, RASTER_MAP_TYPE);
  151. void Rast__interpolate_color_rule(DCELL, unsigned char *, unsigned char *,
  152. unsigned char *, const struct _Color_Rule_ *);
  153. /* color_org.c */
  154. void Rast__organize_colors(struct Colors *);
  155. /* color_out.c */
  156. void Rast_print_colors(struct Colors *, DCELL, DCELL, FILE *, int);
  157. /* color_rand.c */
  158. void Rast_make_random_colors(struct Colors *, CELL, CELL);
  159. /* color_range.c */
  160. void Rast_set_c_color_range(CELL, CELL, struct Colors *);
  161. void Rast_set_d_color_range(DCELL, DCELL, struct Colors *);
  162. void Rast_get_c_color_range(CELL *, CELL *, const struct Colors *);
  163. void Rast_get_d_color_range(DCELL *, DCELL *, const struct Colors *);
  164. /* color_read.c */
  165. int Rast_read_colors(const char *, const char *, struct Colors *);
  166. int Rast__read_colors(const char *, const char *, const char *, struct Colors *);
  167. void Rast_mark_colors_as_fp(struct Colors *);
  168. /* color_remove.c */
  169. int Rast_remove_colors(const char *, const char *);
  170. /* color_rule.c */
  171. void Rast_add_d_color_rule(const DCELL *, int, int, int,
  172. const DCELL *, int, int, int,
  173. struct Colors *);
  174. void Rast_add_f_color_rule(const FCELL *, int, int, int,
  175. const FCELL *, int, int, int,
  176. struct Colors *);
  177. void Rast_add_c_color_rule(const CELL *, int, int, int,
  178. const CELL *, int, int, int,
  179. struct Colors *);
  180. void Rast_add_color_rule(const void *, int, int, int,
  181. const void *, int, int, int,
  182. struct Colors *, RASTER_MAP_TYPE);
  183. int Rast_add_modular_d_color_rule(const DCELL *, int, int, int,
  184. const DCELL *, int, int, int,
  185. struct Colors *);
  186. int Rast_add_modular_f_color_rule(const FCELL *, int, int, int,
  187. const FCELL *, int, int, int,
  188. struct Colors *);
  189. int Rast_add_modular_c_color_rule(const CELL *, int, int, int,
  190. const CELL *, int, int, int,
  191. struct Colors *);
  192. int Rast_add_modular_color_rule(const void *, int, int, int,
  193. const void *, int, int, int,
  194. struct Colors *, RASTER_MAP_TYPE);
  195. /* color_rule_get.c */
  196. int Rast_colors_count(const struct Colors *);
  197. int Rast_get_fp_color_rule(DCELL *, unsigned char *, unsigned char *,
  198. unsigned char *, DCELL *, unsigned char *,
  199. unsigned char *, unsigned char *,
  200. const struct Colors *, int);
  201. /* color_rules.c */
  202. typedef int read_rule_fn(void *, DCELL, DCELL,
  203. DCELL *, int *, int *, int *, int *, int *, int *);
  204. int Rast_parse_color_rule(DCELL, DCELL, const char *, DCELL *, int *, int *,
  205. int *, int *, int *, int *);
  206. const char *Rast_parse_color_rule_error(int);
  207. int Rast_read_color_rule(void *, DCELL, DCELL, DCELL *, int *, int *, int *,
  208. int *, int *, int *);
  209. int Rast_read_color_rules(struct Colors *, DCELL, DCELL, read_rule_fn *, void *);
  210. int Rast_load_colors(struct Colors *, const char *, CELL, CELL);
  211. int Rast_load_fp_colors(struct Colors *, const char *, DCELL, DCELL);
  212. void Rast_make_colors(struct Colors *, const char *, CELL, CELL);
  213. void Rast_make_fp_colors(struct Colors *, const char *, DCELL, DCELL);
  214. /* color_set.c */
  215. void Rast_set_c_color(CELL, int, int, int, struct Colors *);
  216. void Rast_set_d_color(DCELL, int, int, int, struct Colors *);
  217. void Rast_set_null_value_color(int, int, int, struct Colors *);
  218. void Rast_set_default_color(int, int, int, struct Colors *);
  219. /* color_shift.c */
  220. void Rast_shift_c_colors(CELL, struct Colors *);
  221. void Rast_shift_d_colors(DCELL, struct Colors *);
  222. /* color_write.c */
  223. void Rast_write_colors(const char *, const char *, struct Colors *);
  224. void Rast__write_colors(FILE *, struct Colors *);
  225. /* color_xform.c */
  226. void Rast_histogram_eq_colors(struct Colors *, struct Colors *,
  227. struct Cell_stats *);
  228. void Rast_histogram_eq_fp_colors(struct Colors *,
  229. struct Colors *, struct FP_stats *);
  230. void Rast_log_colors(struct Colors *, struct Colors *, int);
  231. void Rast_abs_log_colors(struct Colors *, struct Colors *, int);
  232. /* format.c */
  233. int Rast__check_format(int);
  234. int Rast__read_row_ptrs(int);
  235. int Rast__write_row_ptrs(int);
  236. /* fpreclass.c */
  237. void Rast_fpreclass_clear(struct FPReclass *);
  238. void Rast_fpreclass_reset(struct FPReclass *);
  239. void Rast_fpreclass_init(struct FPReclass *);
  240. void Rast_fpreclass_set_domain(struct FPReclass *, DCELL, DCELL);
  241. void Rast_fpreclass_set_range(struct FPReclass *, DCELL, DCELL);
  242. int Rast_fpreclass_get_limits(const struct FPReclass *, DCELL *, DCELL *,
  243. DCELL *, DCELL *);
  244. int Rast_fpreclass_nof_rules(const struct FPReclass *);
  245. void Rast_fpreclass_get_ith_rule(const struct FPReclass *, int, DCELL *, DCELL *,
  246. DCELL *, DCELL *);
  247. void Rast_fpreclass_set_neg_infinite_rule(struct FPReclass *, DCELL, DCELL);
  248. int Rast_fpreclass_get_neg_infinite_rule(const struct FPReclass *, DCELL *,
  249. DCELL *);
  250. void Rast_fpreclass_set_pos_infinite_rule(struct FPReclass *, DCELL, DCELL);
  251. int Rast_fpreclass_get_pos_infinite_rule(const struct FPReclass *, DCELL *,
  252. DCELL *);
  253. void Rast_fpreclass_add_rule(struct FPReclass *, DCELL, DCELL, DCELL, DCELL);
  254. void Rast_fpreclass_reverse_rule_order(struct FPReclass *);
  255. DCELL Rast_fpreclass_get_cell_value(const struct FPReclass *, DCELL);
  256. void Rast_fpreclass_perform_di(const struct FPReclass *, const DCELL *, CELL *,
  257. int);
  258. void Rast_fpreclass_perform_df(const struct FPReclass *, const DCELL *, FCELL *,
  259. int);
  260. void Rast_fpreclass_perform_dd(const struct FPReclass *, const DCELL *, DCELL *,
  261. int);
  262. void Rast_fpreclass_perform_fi(const struct FPReclass *, const FCELL *, CELL *,
  263. int);
  264. void Rast_fpreclass_perform_ff(const struct FPReclass *, const FCELL *, FCELL *,
  265. int);
  266. void Rast_fpreclass_perform_fd(const struct FPReclass *, const FCELL *, DCELL *,
  267. int);
  268. void Rast_fpreclass_perform_ii(const struct FPReclass *, const CELL *, CELL *,
  269. int);
  270. void Rast_fpreclass_perform_if(const struct FPReclass *, const CELL *, FCELL *,
  271. int);
  272. void Rast_fpreclass_perform_id(const struct FPReclass *, const CELL *, DCELL *,
  273. int);
  274. /* gdal.c */
  275. void Rast_init_gdal(void);
  276. struct GDAL_link *Rast_get_gdal_link(const char *, const char *);
  277. struct GDAL_link *Rast_create_gdal_link(const char *, RASTER_MAP_TYPE);
  278. void Rast_close_gdal_link(struct GDAL_link *);
  279. int Rast_close_gdal_write_link(struct GDAL_link *);
  280. /* get_cellhd.c */
  281. void Rast_get_cellhd(const char *, const char *, struct Cell_head *);
  282. /* get_row.c */
  283. void Rast_get_row_nomask(int, void *, int, RASTER_MAP_TYPE);
  284. void Rast_get_c_row_nomask(int, CELL *, int);
  285. void Rast_get_f_row_nomask(int, FCELL *, int);
  286. void Rast_get_d_row_nomask(int, DCELL *, int);
  287. void Rast_get_row(int, void *, int, RASTER_MAP_TYPE);
  288. void Rast_get_c_row(int, CELL *, int);
  289. void Rast_get_f_row(int, FCELL *, int);
  290. void Rast_get_d_row(int, DCELL *, int);
  291. void Rast_get_null_value_row(int, char *, int);
  292. /* get_row_colr.c */
  293. void Rast_get_row_colors(int, int, struct Colors *,
  294. unsigned char *, unsigned char *, unsigned char *,
  295. unsigned char *);
  296. /* histo_eq.c */
  297. void Rast_histogram_eq(const struct Histogram *, unsigned char **,
  298. CELL *, CELL *);
  299. /* histogram.c */
  300. void Rast_init_histogram(struct Histogram *);
  301. int Rast_read_histogram(const char *, const char *, struct Histogram *);
  302. void Rast_write_histogram(const char *, const struct Histogram *);
  303. void Rast_write_histogram_cs(const char *, struct Cell_stats *);
  304. void Rast_make_histogram_cs(struct Cell_stats *, struct Histogram *);
  305. int Rast_get_histogram_num(const struct Histogram *);
  306. CELL Rast_get_histogram_cat(int, const struct Histogram *);
  307. long Rast_get_histogram_count(int, const struct Histogram *);
  308. void Rast_free_histogram(struct Histogram *);
  309. int Rast_sort_histogram(struct Histogram *);
  310. int Rast_sort_histogram_by_count(struct Histogram *);
  311. void Rast_remove_histogram(const char *);
  312. int Rast_add_histogram(CELL, long, struct Histogram *);
  313. int Rast_set_histogram(CELL, long, struct Histogram *);
  314. void Rast_extend_histogram(CELL, long, struct Histogram *);
  315. void Rast_zero_histogram(struct Histogram *);
  316. /* history.c */
  317. int Rast__read_history(struct History *, FILE *);
  318. int Rast_read_history(const char *, const char *, struct History *);
  319. void Rast__write_history(struct History *, FILE *);
  320. void Rast_write_history(const char *, struct History *);
  321. void Rast_short_history(const char *, const char *, struct History *);
  322. int Rast_command_history(struct History *);
  323. void Rast_append_history(struct History *, const char *);
  324. void Rast_append_format_history(struct History *, const char *, ...)
  325. __attribute__ ((format(printf, 2, 3)));
  326. const char *Rast_get_history(struct History *, int);
  327. void Rast_set_history(struct History *, int, const char *);
  328. void Rast_format_history(struct History *, int, const char *, ...)
  329. __attribute__ ((format(printf, 3, 4)));
  330. void Rast_clear_history(struct History *);
  331. void Rast_free_history(struct History *);
  332. int Rast_history_length(struct History *);
  333. const char *Rast_history_line(struct History *, int);
  334. /* init.c */
  335. void Rast_init(void);
  336. void Rast__check_init(void);
  337. void Rast_init_all(void);
  338. void Rast__init(void);
  339. void Rast__error_handler(void *);
  340. /* interp.c */
  341. DCELL Rast_interp_linear(double, DCELL, DCELL);
  342. DCELL Rast_interp_bilinear(double, double, DCELL, DCELL, DCELL, DCELL);
  343. DCELL Rast_interp_cubic(double, DCELL, DCELL, DCELL, DCELL);
  344. DCELL Rast_interp_bicubic(double, double,
  345. DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL,
  346. DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL,
  347. DCELL);
  348. DCELL Rast_interp_lanczos(double, double, DCELL *);
  349. DCELL Rast_interp_cubic_bspline(double, DCELL, DCELL, DCELL, DCELL);
  350. DCELL Rast_interp_bicubic_bspline(double, double,
  351. DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL,
  352. DCELL, DCELL, DCELL, DCELL, DCELL, DCELL, DCELL,
  353. DCELL);
  354. int Rast_option_to_interp_type(const struct Option *);
  355. /* mask_info.c */
  356. char *Rast_mask_info(void);
  357. int Rast__mask_info(char *, char *);
  358. /* maskfd.c */
  359. int Rast_maskfd(void);
  360. /* null_val.c */
  361. #define Rast_is_c_null_value(cellVal) \
  362. (*(const CELL *)(cellVal) == (CELL) 0x80000000)
  363. #define Rast_is_f_null_value(fcellVal) \
  364. (*(const FCELL *)(fcellVal) != *(const FCELL *)(fcellVal))
  365. #define Rast_is_d_null_value(dcellVal) \
  366. (*(const DCELL *)(dcellVal) != *(const DCELL *)(dcellVal))
  367. void Rast__set_null_value(void *, int, int, RASTER_MAP_TYPE);
  368. void Rast_set_null_value(void *, int, RASTER_MAP_TYPE);
  369. void Rast_set_c_null_value(CELL *, int);
  370. void Rast_set_f_null_value(FCELL *, int);
  371. void Rast_set_d_null_value(DCELL *, int);
  372. int Rast_is_null_value(const void *, RASTER_MAP_TYPE);
  373. #ifndef Rast_is_c_null_value
  374. int Rast_is_c_null_value(const CELL *);
  375. #endif
  376. #ifndef Rast_is_f_null_value
  377. int Rast_is_f_null_value(const FCELL *);
  378. #endif
  379. #ifndef Rast_is_d_null_value
  380. int Rast_is_d_null_value(const DCELL *);
  381. #endif
  382. void Rast_insert_null_values(void *, char *, int, RASTER_MAP_TYPE);
  383. void Rast_insert_c_null_values(CELL *, char *, int);
  384. void Rast_insert_f_null_values(FCELL *, char *, int);
  385. void Rast_insert_d_null_values(DCELL *, char *, int);
  386. int Rast__check_null_bit(const unsigned char *, int, int);
  387. void Rast__convert_01_flags(const char *, unsigned char *, int);
  388. void Rast__convert_flags_01(char *, const unsigned char *, int);
  389. void Rast__init_null_bits(unsigned char *, int);
  390. /* open.c */
  391. int Rast_open_old(const char *, const char *);
  392. int Rast__open_old(const char *, const char *);
  393. int Rast_open_c_new(const char *);
  394. int Rast_open_c_new_uncompressed(const char *);
  395. void Rast_want_histogram(int);
  396. void Rast_set_cell_format(int);
  397. int Rast_get_cell_format(CELL);
  398. int Rast_open_fp_new(const char *);
  399. int Rast_open_fp_new_uncompressed(const char *);
  400. void Rast_set_fp_type(RASTER_MAP_TYPE);
  401. int Rast_map_is_fp(const char *, const char *);
  402. RASTER_MAP_TYPE Rast_map_type(const char *, const char *);
  403. RASTER_MAP_TYPE Rast__check_fp_type(const char *, const char *);
  404. RASTER_MAP_TYPE Rast_get_map_type(int);
  405. int Rast_open_new(const char *, RASTER_MAP_TYPE);
  406. int Rast_open_new_uncompressed(const char *, RASTER_MAP_TYPE);
  407. void Rast_set_quant_rules(int, struct Quant *);
  408. /* put_cellhd.c */
  409. void Rast_put_cellhd(const char *, struct Cell_head *);
  410. /* put_row.c */
  411. void Rast_put_row(int, const void *, RASTER_MAP_TYPE);
  412. void Rast_put_c_row(int, const CELL *);
  413. void Rast_put_f_row(int, const FCELL *);
  414. void Rast_put_d_row(int, const DCELL *);
  415. int Rast__open_null_write(int);
  416. void Rast__write_null_bits(int, const unsigned char *, int, int, int);
  417. /* put_title.c */
  418. int Rast_put_cell_title(const char *, const char *);
  419. /* quant.c */
  420. void Rast_quant_clear(struct Quant *);
  421. void Rast_quant_free(struct Quant *);
  422. int Rast__quant_organize_fp_lookup(struct Quant *);
  423. void Rast_quant_init(struct Quant *);
  424. int Rast_quant_is_truncate(const struct Quant *);
  425. int Rast_quant_is_round(const struct Quant *);
  426. void Rast_quant_truncate(struct Quant *);
  427. void Rast_quant_round(struct Quant *);
  428. int Rast_quant_get_limits(const struct Quant *, DCELL *, DCELL *, CELL *,
  429. CELL *);
  430. int Rast_quant_nof_rules(const struct Quant *);
  431. void Rast_quant_get_ith_rule(const struct Quant *, int, DCELL *, DCELL *, CELL *,
  432. CELL *);
  433. void Rast_quant_set_neg_infinite_rule(struct Quant *, DCELL, CELL);
  434. int Rast_quant_get_neg_infinite_rule(const struct Quant *, DCELL *, CELL *);
  435. void Rast_quant_set_pos_infinite_rule(struct Quant *, DCELL, CELL);
  436. int Rast_quant_get_pos_infinite_rule(const struct Quant *, DCELL *, CELL *);
  437. void Rast_quant_add_rule(struct Quant *, DCELL, DCELL, CELL, CELL);
  438. void Rast_quant_reverse_rule_order(struct Quant *);
  439. CELL Rast_quant_get_cell_value(struct Quant *, DCELL);
  440. void Rast_quant_perform_d(struct Quant *, const DCELL *, CELL *, int);
  441. void Rast_quant_perform_f(struct Quant *, const FCELL *, CELL *, int);
  442. struct Quant_table *Rast__quant_get_rule_for_d_raster_val(const struct Quant *,
  443. DCELL);
  444. /* quant_io.c */
  445. int Rast__quant_import(const char *, const char *, struct Quant *);
  446. int Rast__quant_export(const char *, const char *, const struct Quant *);
  447. /* quant_rw.c */
  448. void Rast_truncate_fp_map(const char *, const char *);
  449. void Rast_round_fp_map(const char *, const char *);
  450. void Rast_quantize_fp_map(const char *, const char *, CELL, CELL);
  451. void Rast_quantize_fp_map_range(const char *, const char *, DCELL, DCELL, CELL,
  452. CELL);
  453. void Rast_write_quant(const char *, const char *, const struct Quant *);
  454. int Rast_read_quant(const char *, const char *, struct Quant *);
  455. /* range.c */
  456. void Rast__remove_fp_range(const char *);
  457. void Rast_construct_default_range(struct Range *);
  458. int Rast_read_fp_range(const char *, const char *, struct FPRange *);
  459. int Rast_read_range(const char *, const char *, struct Range *);
  460. void Rast_write_range(const char *, const struct Range *);
  461. void Rast_write_fp_range(const char *, const struct FPRange *);
  462. void Rast_update_range(CELL, struct Range *);
  463. void Rast_update_fp_range(DCELL, struct FPRange *);
  464. void Rast_row_update_range(const CELL *, int, struct Range *);
  465. void Rast__row_update_range(const CELL *, int, struct Range *, int);
  466. void Rast_row_update_fp_range(const void *, int, struct FPRange *,
  467. RASTER_MAP_TYPE);
  468. void Rast_init_range(struct Range *);
  469. void Rast_get_range_min_max(const struct Range *, CELL *, CELL *);
  470. void Rast_init_fp_range(struct FPRange *);
  471. void Rast_get_fp_range_min_max(const struct FPRange *, DCELL *, DCELL *);
  472. /* raster.c */
  473. int Rast_raster_cmp(const void *, const void *, RASTER_MAP_TYPE);
  474. void Rast_raster_cpy(void *, const void *, int, RASTER_MAP_TYPE);
  475. void Rast_set_c_value(void *, CELL, RASTER_MAP_TYPE);
  476. void Rast_set_f_value(void *, FCELL, RASTER_MAP_TYPE);
  477. void Rast_set_d_value(void *, DCELL, RASTER_MAP_TYPE);
  478. CELL Rast_get_c_value(const void *, RASTER_MAP_TYPE);
  479. FCELL Rast_get_f_value(const void *, RASTER_MAP_TYPE);
  480. DCELL Rast_get_d_value(const void *, RASTER_MAP_TYPE);
  481. /* raster_metadata.c */
  482. char *Rast_read_units(const char *, const char *);
  483. char *Rast_read_vdatum(const char *, const char *);
  484. void Rast_write_units(const char *, const char *);
  485. void Rast_write_vdatum(const char *, const char *);
  486. /* reclass.c */
  487. int Rast_is_reclass(const char *, const char *, char *, char *);
  488. int Rast_is_reclassed_to(const char *, const char *, int *, char ***);
  489. int Rast_get_reclass(const char *, const char *, struct Reclass *);
  490. void Rast_free_reclass(struct Reclass *);
  491. int Rast_put_reclass(const char *, const struct Reclass *);
  492. /* sample.c */
  493. DCELL Rast_get_sample_nearest(int, const struct Cell_head *, struct Categories *, double, double, int);
  494. DCELL Rast_get_sample_bilinear(int, const struct Cell_head *, struct Categories *, double, double, int);
  495. DCELL Rast_get_sample_cubic(int, const struct Cell_head *, struct Categories *, double, double, int);
  496. DCELL Rast_get_sample(int, const struct Cell_head *, struct Categories *, double, double, int, INTERP_TYPE);
  497. /* set_window.c */
  498. void Rast__init_window(void);
  499. void Rast_set_window(struct Cell_head *);
  500. void Rast_unset_window(void);
  501. void Rast_set_output_window(struct Cell_head *);
  502. void Rast_set_input_window(struct Cell_head *);
  503. /* window.c */
  504. void Rast_get_window(struct Cell_head *);
  505. void Rast_get_input_window(struct Cell_head *);
  506. void Rast_get_output_window(struct Cell_head *);
  507. int Rast_window_rows(void);
  508. int Rast_window_cols(void);
  509. int Rast_input_window_rows(void);
  510. int Rast_input_window_cols(void);
  511. int Rast_output_window_rows(void);
  512. int Rast_output_window_cols(void);
  513. double Rast_northing_to_row(double, const struct Cell_head *);
  514. double Rast_easting_to_col(double, const struct Cell_head *);
  515. double Rast_row_to_northing(double, const struct Cell_head *);
  516. double Rast_col_to_easting(double, const struct Cell_head *);
  517. /* window_map.c */
  518. void Rast__create_window_mapping(int);
  519. int Rast_row_repeat_nomask(int, int);
  520. /* zero_cell.c */
  521. void Rast_zero_buf(void *, RASTER_MAP_TYPE);
  522. void Rast_zero_input_buf(void *, RASTER_MAP_TYPE);
  523. void Rast_zero_output_buf(void *, RASTER_MAP_TYPE);
  524. #endif /* GRASS_RASTERDEFS_H */