home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / xview / xhist / comp_hist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-17  |  2.7 KB  |  130 lines

  1.  
  2. #include <hipl_format.h>
  3.  
  4. #include <stdio.h>
  5. #include <sys/param.h>
  6. #include <sys/types.h>
  7. #include <math.h>
  8.  
  9. #define Calloc(x,y) (y *)calloc((unsigned)(x), sizeof(y))
  10. #define Fread(a,b,c,d) pread(d, (char *)(a), b*(int)(c) )
  11. #define Cfree(x,y,z) cfree((char *)(x), (unsigned)(y), z)
  12.  
  13. /* global image stuff */
  14. byte   *barray;
  15. short  *sarray;
  16. int      *iarray;
  17. float    *farray;
  18.  
  19. int       pix_format;           /* byte, short, int, float  */
  20.  
  21. int       size = 0;             /* size of image */
  22.  
  23. int b_hist[256];  /*  byte histogram    */
  24.  
  25. float val_min;  /*  for byte,  short    */
  26. float val_Max;
  27. int occ_Max;
  28.  
  29. int occ_Max_i;
  30. float occ_Max_f;
  31.  
  32. int *s_hist;  /*  [-32768:32767]  short histogram    */
  33.  
  34. int n_of_dv;  /*  number of different values        */
  35.  
  36. int cur_nofdv;  /*  number of different values on the current graph  */
  37.  
  38. typedef struct ihtype {
  39.     int pv;   /*  pixel value    */
  40.     int occ;  /*  occurrence    */
  41.     struct ihtype *next;
  42.     } Ihtype;  /*  int hist type    */
  43.  
  44. typedef struct ihtype_a {
  45.     int pv;   /*  pixel value    */
  46.     int occ;  /*  occurrence    */
  47.     } Ihtype_a;  /*  int hist type    */
  48.  
  49. typedef struct fhtype_a {
  50.     float pv;   /*  pixel value    */
  51.     int occ;  /*  occurrence    */
  52.     } Fhtype_a;  /*  float hist type    */
  53.  
  54. typedef struct fhtype {
  55.     float pv;   /*  pixel value    */
  56.     int occ;  /*  occurrence    */
  57.     struct fhtype *next;
  58.     } Fhtype;  /*  float hist type    */
  59.  
  60. Ihtype *i0_hist;  /*  int histogram    */
  61. Ihtype_a *i_hist;  /*  int histogram    */
  62.  
  63. Fhtype *f0_hist;  /*  float histogram    */
  64. Fhtype_a *f_hist;
  65.  
  66. int Base;  /*  base index of f_hist[]    */
  67.  
  68. char hint_s[30][50];  /*  hint string    */
  69.  
  70. int Top;
  71.  
  72. int Bottom;
  73.  
  74. int histo_graph[1000];  /*  histogram graph    */
  75.  
  76. int histo_va[1000];  /*  current histo_graph value  */
  77.  
  78. int range;  /*  range of indices of histo_graph to show      */
  79.  
  80. float fhisto_va[1000];  /*  current histo_graph value  */
  81.  
  82. extern int NewLeft;
  83. extern int NewRight;
  84. extern int NewTop;
  85. extern int NewBottom;
  86.  
  87. char *cur_fname;  /*  current file name    */
  88.  
  89. int paint;  /*  0:      fisrt picture of this image
  90.         1:  not fisrt picture of this image     */
  91.  
  92. int y_label[10];
  93.  
  94. int end_y;  /*  end of y_label[]    */
  95.  
  96. int x_label[20];
  97.  
  98. int end_x;  /*  end of x_label[]    */
  99.  
  100. float fx_label[20];
  101.  
  102. float fy_label[20];
  103.  
  104. float pv_diff;  /*  pixel value difference    */
  105.  
  106. int occ_diff; /*  occurrence difference      */
  107.  
  108. int x_pos[20];
  109.  
  110. int y_pos[20];
  111.  
  112. extern int TXTWD; /*  text width    */
  113.  
  114. extern int CV_HT; /*canvas height */
  115.  
  116. extern float HGT;  /*  height of histogram               */
  117.  
  118. extern int TXTHT;   /* height of text in canvas */
  119.  
  120. int cur_size;  /*  size of current graph        */
  121.  
  122. int cnt_size;  /* pv_cnt[] size            */
  123.  
  124. int *pv_cnt;  /*  pv-->count,  to compute i_hist[] and f_hist[]        */
  125.  
  126. extern int nrow;
  127. extern int ncol;
  128. extern int nfr;
  129.  
  130.