home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / unix / saoimage / sao1_07.tar / hfiles / histeq.h < prev    next >
C/C++ Source or Header  |  1989-11-09  |  2KB  |  37 lines

  1. #ifndef lint
  2. static char SccsHistEqId[] = "%W%  %G%";
  3. #endif
  4.  
  5. /* Module:    HistEq.h
  6.  * Purpose:    Define the structs for histogram equalization
  7.  * Modified:    {0} Michael VanHilst    initial version          30 May 1989
  8.  *        {n} <who> -- <does what> -- <when>
  9.  */
  10.  
  11. #define MAX(a,b) (((a) > (b)) ? (a) : (b))
  12.  
  13. /* link describes a section of the histogram to have levels allocated */
  14. typedef struct histogramLink {
  15.   int low;        /* index of lowest histogram entry */
  16.   int high;            /* index of highest histogram entry */
  17.   int range;            /* number of histogram entries covered */
  18.   int nz_entries;        /* number of non-zero histogram entries */
  19.   int pixel_area;        /* number of image pixels within range */
  20.   int max_entry;        /* largest area for any single entry */
  21.   int excess_pixels;        /* pixel area in excess of average */
  22.   int color_levels;            /* number of color levels allocated */
  23.   struct histogramLink *next;    /* link list pointer */
  24.   int pad;
  25. } SubrangeLink;
  26.  
  27. /* list describing details of color level allocation for a histogram range */
  28. typedef struct histogramList {
  29.   int pixel_area;    /* pixel area that is covered by this color level */
  30.   int first, last;    /* first and last histogram entries cor this color */
  31.   int pad;
  32.   int shrink_area;    /* area covered by omitting last non-zero entry */
  33.   int shrink_entry;    /* index for last to excude last non-zero entry */
  34.   int stretch_area;    /* area covered by including next non-zero entry */
  35.   int stretch_entry;    /* index for last to include next non-zero entry */
  36. } SubrangeList;
  37.