imagery.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #ifndef GRASS_IMAGERY_H
  2. #define GRASS_IMAGERY_H
  3. #include <grass/gis.h>
  4. #include <grass/raster.h>
  5. /* File/directory name lengths */
  6. #define INAME_LEN GNAME_MAX /* coupled to raster map name length */
  7. struct Ref_Color
  8. {
  9. unsigned char *table; /* color table for min-max values */
  10. unsigned char *index; /* data translation index */
  11. unsigned char *buf; /* data buffer for reading color file */
  12. int fd; /* for image i/o */
  13. CELL min, max; /* min,max CELL values */
  14. int n; /* index into Ref_Files */
  15. };
  16. struct Ref_Files
  17. {
  18. char name[INAME_LEN]; /* length is not in sync with other definitions */
  19. char mapset[INAME_LEN];
  20. };
  21. struct Ref
  22. {
  23. int nfiles;
  24. struct Ref_Files *file;
  25. struct Ref_Color red, grn, blu;
  26. };
  27. struct Tape_Info
  28. {
  29. char title[75];
  30. char id[2][75];
  31. char desc[5][75];
  32. };
  33. struct Control_Points
  34. {
  35. int count;
  36. double *e1;
  37. double *n1;
  38. double *e2;
  39. double *n2;
  40. int *status;
  41. };
  42. struct One_Sig
  43. {
  44. char desc[100];
  45. int npoints;
  46. double *mean; /* one mean for each band */
  47. double **var; /* covariance band-band */
  48. int status; /* may be used to 'delete' a signature */
  49. float r, g, b; /* color */
  50. int have_color;
  51. };
  52. struct Signature
  53. {
  54. int nbands;
  55. int nsigs;
  56. char title[100];
  57. struct One_Sig *sig;
  58. };
  59. struct SubSig
  60. {
  61. double N;
  62. double pi;
  63. double *means;
  64. double **R;
  65. double **Rinv;
  66. double cnst;
  67. int used;
  68. };
  69. struct ClassData
  70. {
  71. int npixels;
  72. int count;
  73. double **x; /* pixel list: x[npixels][nbands] */
  74. double **p; /* prob p[npixels][subclasses] */
  75. };
  76. struct ClassSig
  77. {
  78. long classnum;
  79. char *title;
  80. int used;
  81. int type;
  82. int nsubclasses;
  83. struct SubSig *SubSig;
  84. struct ClassData ClassData;
  85. };
  86. struct SigSet
  87. {
  88. int nbands;
  89. int nclasses;
  90. char *title;
  91. struct ClassSig *ClassSig;
  92. };
  93. #define SIGNATURE_TYPE_MIXED 1
  94. #define GROUPFILE "CURGROUP"
  95. #define SUBGROUPFILE "CURSUBGROUP"
  96. #include <grass/imagedefs.h>
  97. #endif