rasterdefs.h 24 KB

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