imagery.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. #ifndef GRASS_IMAGEDEFS_H
  2. #define GRASS_IMAGEDEFS_H
  3. /* alloc.c */
  4. void *I_malloc(size_t);
  5. void *I_realloc(void *, size_t);
  6. int I_free(void *);
  7. double **I_alloc_double2(int, int);
  8. int *I_alloc_int(int);
  9. int **I_alloc_int2(int, int);
  10. int I_free_int2(int **);
  11. int I_free_double2(double **);
  12. double ***I_alloc_double3(int, int, int);
  13. int I_free_double3(double ***);
  14. /* eol.c */
  15. int I_get_to_eol(char *, int, FILE *);
  16. /* find.c */
  17. int I_find_group(const char *);
  18. int I_find_group2(const char *, const char *);
  19. int I_find_group_file(const char *, const char *);
  20. int I_find_group_file2(const char *, const char *, const char *);
  21. int I_find_subgroup(const char *, const char *);
  22. int I_find_subgroup2(const char *, const char *, const char *);
  23. int I_find_subgroup_file(const char *, const char *, const char *);
  24. int I_find_subgroup_file2(const char *, const char *, const char *, const char *);
  25. const char *I_find_signature(I_SIGFILE_TYPE, char *, const char *);
  26. const char *I_find_signature2(I_SIGFILE_TYPE, const char *, const char *);
  27. /* fopen.c */
  28. FILE *I_fopen_group_file_new(const char *, const char *);
  29. FILE *I_fopen_group_file_append(const char *, const char *);
  30. FILE *I_fopen_group_file_old(const char *, const char *);
  31. FILE *I_fopen_group_file_old2(const char *, const char *, const char *);
  32. FILE *I_fopen_subgroup_file_new(const char *, const char *, const char *);
  33. FILE *I_fopen_subgroup_file_append(const char *, const char *, const char *);
  34. FILE *I_fopen_subgroup_file_old(const char *, const char *, const char *);
  35. FILE *I_fopen_subgroup_file_old2(const char *, const char *, const char *, const char *);
  36. /* georef.c */
  37. int I_compute_georef_equations(struct Control_Points *, double *, double *,
  38. double *, double *, int);
  39. int I_georef(double, double, double *, double *, double *, double *, int);
  40. /* georef_tps.c */
  41. int I_compute_georef_equations_tps(struct Control_Points *, double **, double **,
  42. double **, double **);
  43. int I_georef_tps(double, double, double *, double *, double *, double *,
  44. struct Control_Points *, int);
  45. /* group.c */
  46. int I_get_group(char *);
  47. int I_put_group(const char *);
  48. int I_get_subgroup(const char *, char *);
  49. int I_put_subgroup(const char *, const char *);
  50. int I_get_group_ref(const char *, struct Ref *);
  51. int I_get_group_ref2(const char *, const char *, struct Ref *);
  52. int I_get_subgroup_ref(const char *, const char *, struct Ref *);
  53. int I_get_subgroup_ref2(const char *, const char *, const char *, struct Ref *);
  54. int I_init_ref_color_nums(struct Ref *);
  55. int I_put_group_ref(const char *, const struct Ref *);
  56. int I_put_subgroup_ref(const char *, const char *, const struct Ref *);
  57. int I_add_file_to_group_ref(const char *, const char *, struct Ref *);
  58. int I_transfer_group_ref_file(const struct Ref *, int, struct Ref *);
  59. int I_init_group_ref(struct Ref *);
  60. int I_free_group_ref(struct Ref *);
  61. /* iclass.c */
  62. struct Map_info;
  63. int I_iclass_analysis(IClass_statistics *, struct Ref *, struct Map_info *, const char *, const char *, const char *);
  64. int I_iclass_init_group(const char *, const char *, struct Ref *);
  65. void I_iclass_create_raster(IClass_statistics *, struct Ref *, const char *);
  66. /* iclass_statistics.c */
  67. void I_iclass_statistics_get_nbands(IClass_statistics *, int *);
  68. void I_iclass_statistics_get_cat(IClass_statistics *, int *);
  69. void I_iclass_statistics_get_name(IClass_statistics *, const char **);
  70. void I_iclass_statistics_get_color(IClass_statistics *, const char **);
  71. void I_iclass_statistics_get_ncells(IClass_statistics *, int *);
  72. int I_iclass_statistics_get_max(IClass_statistics *, int, int *);
  73. int I_iclass_statistics_get_range_max(IClass_statistics *, int, int *);
  74. int I_iclass_statistics_get_min(IClass_statistics *, int, int *);
  75. int I_iclass_statistics_get_range_min(IClass_statistics *, int, int *);
  76. int I_iclass_statistics_get_sum(IClass_statistics *, int, float *);
  77. int I_iclass_statistics_get_mean(IClass_statistics *, int, float *);
  78. int I_iclass_statistics_get_stddev(IClass_statistics *, int, float *);
  79. void I_iclass_statistics_get_nstd(IClass_statistics *, float *);
  80. void I_iclass_statistics_set_nstd(IClass_statistics *, float);
  81. int I_iclass_statistics_get_histo(IClass_statistics *, int, int, int *);
  82. int I_iclass_statistics_get_product(IClass_statistics *, int, int, float *);
  83. void I_iclass_init_statistics(IClass_statistics *, int, const char *, const char *, float);
  84. void I_iclass_free_statistics(IClass_statistics *);
  85. /* iclass_signatures.c */
  86. int I_iclass_init_signatures(struct Signature *, struct Ref *);
  87. void I_iclass_add_signature(struct Signature *, IClass_statistics *);
  88. int I_iclass_write_signatures(struct Signature *, const char *);
  89. /* list_gp.c */
  90. int I_list_group(const char *, const struct Ref *, FILE *);
  91. int I_list_group_simple(const struct Ref *, FILE *);
  92. void I__list_group_name_fit(char *, const char *, const char *);
  93. /* list_subgp.c */
  94. char ** I_list_subgroups(const char *, int *);
  95. char ** I_list_subgroups2(const char *, const char *, int *);
  96. int I_list_subgroup(const char *, const char *, const struct Ref *, FILE *);
  97. int I_list_subgroup_simple(const struct Ref *, FILE *);
  98. /* loc_info.c */
  99. char *I_location_info(const char *);
  100. /* points.c */
  101. int I_new_control_point(struct Control_Points *, double, double, double,
  102. double, int);
  103. int I_get_control_points(const char *, struct Control_Points *);
  104. int I_put_control_points(const char *, const struct Control_Points *);
  105. /* ref.c */
  106. FILE *I_fopen_group_ref_new(const char *);
  107. FILE *I_fopen_group_ref_old(const char *);
  108. FILE *I_fopen_group_ref_old2(const char *, const char *);
  109. FILE *I_fopen_subgroup_ref_new(const char *, const char *);
  110. FILE *I_fopen_subgroup_ref_old(const char *, const char *);
  111. FILE *I_fopen_subgroup_ref_old2(const char *, const char *, const char *);
  112. /* iscatt_structs.c */
  113. void I_sc_init_cats(struct scCats *, int, int);
  114. void I_sc_free_cats(struct scCats *);
  115. int I_sc_add_cat(struct scCats *);
  116. int I_sc_insert_scatt_data(struct scCats *, struct scdScattData *, int, int);
  117. void I_scd_init_scatt_data(struct scdScattData *, int, int, void *);
  118. /* iscatt_core.c */
  119. int I_compute_scatts(struct Cell_head *, struct scCats *, const char **,
  120. const char **, int, struct scCats *, const char **);
  121. int I_create_cat_rast(struct Cell_head *, const char *);
  122. int I_insert_patch_to_cat_rast(const char *, struct Cell_head *, const char *);
  123. int I_id_scatt_to_bands(const int, const int, int *, int *);
  124. int I_bands_to_id_scatt(const int, const int, const int, int *);
  125. int I_merge_arrays(unsigned char *, unsigned char *, unsigned, unsigned, double);
  126. int I_apply_colormap(unsigned char *, unsigned char *, unsigned, unsigned char *, unsigned char *);
  127. int I_rasterize(double *, int, unsigned char, struct Cell_head *, unsigned char *);
  128. /* manage_signatures.c */
  129. void I_get_signatures_dir(char *, I_SIGFILE_TYPE);
  130. void I_make_signatures_dir(I_SIGFILE_TYPE);
  131. int I_signatures_remove(I_SIGFILE_TYPE, const char *);
  132. int I_signatures_copy(I_SIGFILE_TYPE, const char *, const char *, const char *);
  133. int I_signatures_rename(I_SIGFILE_TYPE, const char *, const char *);
  134. int I_signatures_list_by_type(I_SIGFILE_TYPE, const char *, char ***);
  135. void I_free_signatures_list(int, char ***);
  136. /* sig.c */
  137. int I_init_signatures(struct Signature *, int);
  138. int I_new_signature(struct Signature *);
  139. int I_free_signatures(struct Signature *);
  140. int I_read_one_signature(FILE *, struct Signature *);
  141. int I_read_signatures(FILE *, struct Signature *);
  142. int I_write_signatures(FILE *, struct Signature *);
  143. char **I_sort_signatures_by_semantic_label(struct Signature *, const struct Ref *);
  144. /* sigfile.c */
  145. FILE *I_fopen_signature_file_new(const char *);
  146. FILE *I_fopen_signature_file_old(const char *);
  147. /* sigset.c */
  148. int I_SigSetNClasses(struct SigSet *);
  149. struct ClassData *I_AllocClassData(struct SigSet *, struct ClassSig *, int);
  150. int I_InitSigSet(struct SigSet *, int);
  151. struct ClassSig *I_NewClassSig(struct SigSet *);
  152. struct SubSig *I_NewSubSig(struct SigSet *, struct ClassSig *);
  153. int I_ReadSigSet(FILE *, struct SigSet *) WARN_UNUSED_RESULT;
  154. int I_SetSigTitle(struct SigSet *, const char *);
  155. const char *I_GetSigTitle(const struct SigSet *);
  156. int I_SetClassTitle(struct ClassSig *, const char *);
  157. const char *I_GetClassTitle(const struct ClassSig *);
  158. int I_WriteSigSet(FILE *, const struct SigSet *);
  159. char **I_SortSigSetBySemanticLabel(struct SigSet *, const struct Ref *);
  160. /* sigsetfile.c */
  161. FILE *I_fopen_sigset_file_new(const char *);
  162. FILE *I_fopen_sigset_file_old(const char *);
  163. /* target.c */
  164. int I_get_target(const char *, char *, char *);
  165. int I_put_target(const char *, const char *, const char *);
  166. /* title.c */
  167. int I_get_group_title(const char *, char *, int);
  168. int I_put_group_title(const char *, const char *);
  169. /* var.c */
  170. double I_variance(double, double, int);
  171. double I_stddev(double, double, int);
  172. #endif