home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / xview / genial / include / histo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-14  |  2.6 KB  |  70 lines

  1. /*
  2.  * histo.h -- definitions for histograms
  3.  *
  4.  */
  5.  
  6. #include "histo_ui.h"
  7.  
  8. extern histo_histo_ctrl_objects    *histo_ctrl;
  9.  
  10. #define NUM_BUCKETS 512         /* number of histogram buckets */
  11. #define NUM_SUB 8               /* number of sub intervals */
  12.  
  13. #define GRWIDTH 512
  14. #define GRHGT 280
  15. #define SX 10
  16. #define SY 10
  17.  
  18. /* the following structure defined by antony to facilitate histogram
  19.    'lookback' to the original image */
  20.  
  21. struct lbent {
  22.   XPoint *parr; /*the dynamically sized vector of points which compose this
  23.                   histogram bucket */
  24.   int asize; /* size of parr.  Never decremented.  We never free() parr, we
  25.                 just let it fault itself in */
  26.   int npts; /* reset to zero for every histogram, number of points in this
  27.                bucket.  same hdata[index] above... */
  28. };
  29.  
  30.  
  31. /* the following is just to store upper and lower bounds for each of the
  32.    six lookback colors. */
  33. struct subrange {
  34.   int isactive;   /* flag to indicate that this subrange is in use */
  35.   int lower, upper; /*each of these is a bucket */
  36.   int islit; /* 0 if unlit, 1 if lit */
  37. };
  38.  
  39. struct hcontext {
  40.   int rtype; /* indicates the region type of histogram.  One of BOX, POLYGON,
  41.         or CLSPLINE.  NOREG is used to indicate that this is a free
  42.            context which may be recycled */
  43.   int minv, maxv; /* local extrema for this histogram only.  Fairly painful to
  44.              search for them when called, but means there is less
  45.              wasted bucket space.  Could be controllable by a control
  46.              panel item */
  47.   XPoint *pbuf; /* buffer of the points associated with this histogram.  A
  48.            necessary evil */
  49.   int pbsize, pblen; /* size of above and length of above.  Size only changes
  50.                 when we realloc(), len is number of actual points */
  51.   int countvec[NUM_BUCKETS]; /* the actual counts for histogram information */
  52.   struct lbent lbtab[NUM_BUCKETS]; /* table to look back at the original
  53.                       image.  Built when histogram is
  54.                       computed.  */
  55.   int maxc, minc; /* max and min counts for vertical labelings */
  56.  
  57.   histo_display_objects *histo_display; /* window containing the histogram */
  58.   Xv_window paintwin; /* xid of the paintwin associated with this window */
  59.   XID hxid; /* xid of the paintwin associated with this window */
  60.   struct subrange interval[NUM_SUB]; /* a selected subinterval */
  61.   int subnum; /* number of the presently active subrange */
  62.  
  63.   int minb, maxb; /* min and max. bucket.  Used for magnification.  Default is
  64.              0 and NUM_BUCKETS, obviously */
  65.   struct graph_lab *xglab, *yglab; /* the graph labels along the X and Y
  66.                       axes. */
  67.   int xglen, yglen; /* number of entries in the above glab vectors. */
  68. };
  69.  
  70.