home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / IMGPROC.ZIP / C8.ZIP / IMAGESUP.H < prev   
Encoding:
C/C++ Source or Header  |  1990-04-06  |  3.0 KB  |  90 lines

  1. /*  
  2. Copyright 1990 by John Wiley & Sons, Inc.
  3.           All Rights Reserved.
  4. */
  5. /****************************************/
  6. /*    Image Processing Header File      */
  7. /*       written in Turbo C 2.0         */
  8. /*                by                    */
  9. /*         Craig A. Lindley             */
  10. /*                                      */
  11. /*   Vers: 1.0  Last Update: 12/26/89   */
  12. /****************************************/
  13.  
  14. /*
  15. This file includes the general equates used for all of the
  16. image processing code in part two of this book. Throughout
  17. these equates, a 320x200 256 color image is assumed. If the
  18. resolution of the processed pictures change, the equates
  19. MAXCOLS and MAXROWS must change accordingly.
  20. */
  21.  
  22. /* Pixel Sample Information and Equates */
  23. #define MAXSAMPLEBITS   6         /* 6 bits from digitizer */
  24. #define MINSAMPLEVAL    0         /* Min sample value = 0 */
  25.  
  26. /* Max num of sample values */
  27. #define MAXQUANTLEVELS (1<<MAXSAMPLEBITS)
  28. /* Max sample value = 63 */
  29. #define MAXSAMPLEVAL   (MAXQUANTLEVELS-1)
  30.  
  31. /* Image Resolution Equates */
  32. #define MINCOLNUM       0         /* Column 0 */
  33. #define MAXCOLS       LRMAXCOLS   /* 320 total columns */
  34. #define MAXCOLNUM     (MAXCOLS-1) /* Last column is 319 */
  35. #define MINROWNUM       0         /* Row 0 */
  36. #define MAXROWS       LRMAXROWS   /* 200 total rows */
  37. #define MAXROWNUM     (MAXROWS-1) /* Last row is 199 */
  38.  
  39. #define RASTERSIZE ((long)MAXCOLS * MAXROWS)
  40. #define MAXNUMGRAYCOLORS MAXQUANTLEVELS
  41.  
  42. /* histogram equates */
  43. #define HISTOCOL        0
  44. #define HISTOROW        0
  45. #define HISTOWIDTH    134
  46. #define HISTOHEIGHT    84
  47.  
  48. #define BLACK          0
  49. #define WHITE         63
  50.  
  51. #define AXISCOL       (HISTOCOL+3)
  52. #define AXISROW       (HISTOROW+HISTOHEIGHT-5)
  53. #define AXISLENGTH    MAXQUANTLEVELS*2-1
  54. #define DATACOL       AXISCOL
  55. #define DATAROW       AXISROW-1
  56. #define MAXDEFLECTION (HISTOHEIGHT-10)
  57.  
  58. /* External Function Declarations and Prototypes */
  59.  
  60. void CopyImage(BYTE huge *SourceBuf, BYTE huge *DestBuf);
  61.  
  62. BYTE GetPixelFromImage(BYTE huge *Image, unsigned Col, unsigned Row);
  63.  
  64. CompletionCode PutPixelInImage(BYTE huge *Image, unsigned Col,
  65.                    unsigned Row, unsigned Color);
  66.  
  67. CompletionCode DrawHLine(BYTE huge *Image, unsigned Col, unsigned Row,
  68.              unsigned Length, unsigned Color);
  69.  
  70. CompletionCode DrawVLine(BYTE huge *Image, unsigned Col, unsigned Row,
  71.              unsigned Length, unsigned Color);
  72.  
  73. void ReadImageAreaToBuf (BYTE huge *Image, unsigned Col, unsigned Row,
  74.              unsigned Width, unsigned Height,
  75.              BYTE huge *Buffer);
  76.  
  77. void WriteImageAreaFromBuf (BYTE huge *Buffer, unsigned BufWidth,
  78.                 unsigned BufHeight, BYTE huge *Image,
  79.                 unsigned ImageCol, unsigned ImageRow);
  80.  
  81. void ClearImageArea(BYTE huge *Image,unsigned Col, unsigned Row,
  82.             unsigned Width, unsigned Height,
  83.             unsigned PixelValue);
  84.  
  85. CompletionCode ParameterCheckOK(unsigned Col, unsigned Row,
  86.                           unsigned ColExtent, unsigned RowExtent,
  87.                           char *ErrorStr);
  88.  
  89.  
  90.