imagery.h 2.0 KB

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