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

  1. #ifndef lint
  2. static char SccsBufId[] = "%W%  %G%";
  3. #endif
  4.  
  5. /* Module:    Buffer.h
  6.  * Purpose:    Define structure to hold and describe buffers for imaging
  7.  * Modified:    {0} Michael VanHilst    initial version          1 December 1988
  8.  *        {n} <who> -- <does what> -- <when>
  9.  */
  10.  
  11. /* Notes:
  12.  *  Image data is stored as 16 bit signed integers
  13.  *  Data may have been scaled and biased from image file as per Image.h
  14.  *  Scalemap and histogram have one cell per possible 16 bit value
  15.  *   Scalemap has its mapping to screen display values
  16.  *   Histogram counts the number of its occurences in the display image section
  17.  *  Scalemap and Histogram are the alloc pointers, they must be offset by
  18.  *   ZERO_OFFSET to use them as an array with the signed integer as index
  19.  *  Min and max establish the range for which mapping is figured
  20.  *   mm parameters refer to the previous calculation of the histogram and
  21.  *   can be used to determine if it needs to be updated for a different section
  22.  *  zoomsum refers to mapping adjustments that may be needed if summed blocking
  23.  *   is used in file reading, as different zooms will change the range of
  24.  *   values in the buffer
  25.  *  Panbuf contains a sample of the full image for use in making the pan
  26.  *   window display.  It has the same size as the pan window for fast access
  27.  */
  28.  
  29. struct sampleRec {
  30.   int img_leftX, img_rightX;
  31.   int img_topY, img_lowY;
  32. };
  33.  
  34. struct bufferRec {
  35.   char *filebuf;        /* pointer to input data buffer (any type) */
  36.   short *shortbuf;        /* 16 bit image array storage */
  37.   short *panbuf;        /* 16 bit image array storage for pan box */
  38.   int filebuf_sz;        /* number of bytes allocated for filebuf */
  39.   int shortbuf_sz;        /* number of shorts allocated */
  40.   int panbuf_sz;
  41.   int shortbuf_square;        /* got excess buffer size (for rotation) */
  42.   int shortbuf_double;
  43.   /* measurement of min and max (always followed by rescaling) */
  44.   int clipmin, clipmax;        /* fimin and fimax in shortbuf, if used */
  45.   double cmdMin, cmdMax;    /* min and max values from command line */
  46.   int cmdmin, cmdmax;        /* cmdmin/max as scaled to img values */
  47.   int scale_min, scale_max;    /* img min and max values for scaling */
  48.   int min_given, max_given;    /* scale min and max given from command line */
  49.   int hist_area;        /* effective histogram area for histeq */
  50.   int pad;
  51.   struct sampleRec mm;        /* info about when minmax determined */
  52.   int *histogram;        /* 64k map for histogramming data */
  53.   /* img short int to hardware byte scale map */
  54.   unsigned char *scalemap;    /* 64k map for digitizing to fewer levels */
  55.   /* parameters for comparing values with different summing block areas */
  56.   int panbuf_summing;        /* block summing manifest in pan buffer */
  57.   int shortbuf_summing;        /* block summing for shortbuf values */
  58.   int scalemap_summing;        /* block summing of histogram when smap made */
  59.   /* support for buffer to display scaling */
  60.   int panbuf_max;        /* maximum value in pan buffer */
  61.   int shortbuf_max;
  62.   int load_filebuf;        /* OK and request to load data */
  63. };
  64.