home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright 1990 by John Wiley & Sons, Inc.
- All Rights Reserved.
- */
- /****************************************/
- /* Image Processing Header File */
- /* written in Turbo C 2.0 */
- /* by */
- /* Craig A. Lindley */
- /* */
- /* Vers: 1.0 Last Update: 12/26/89 */
- /****************************************/
-
- /*
- This file includes the general equates used for all of the
- image processing code in part two of this book. Throughout
- these equates, a 320x200 256 color image is assumed. If the
- resolution of the processed pictures change, the equates
- MAXCOLS and MAXROWS must change accordingly.
- */
-
- /* Pixel Sample Information and Equates */
- #define MAXSAMPLEBITS 6 /* 6 bits from digitizer */
- #define MINSAMPLEVAL 0 /* Min sample value = 0 */
-
- /* Max num of sample values */
- #define MAXQUANTLEVELS (1<<MAXSAMPLEBITS)
- /* Max sample value = 63 */
- #define MAXSAMPLEVAL (MAXQUANTLEVELS-1)
-
- /* Image Resolution Equates */
- #define MINCOLNUM 0 /* Column 0 */
- #define MAXCOLS LRMAXCOLS /* 320 total columns */
- #define MAXCOLNUM (MAXCOLS-1) /* Last column is 319 */
- #define MINROWNUM 0 /* Row 0 */
- #define MAXROWS LRMAXROWS /* 200 total rows */
- #define MAXROWNUM (MAXROWS-1) /* Last row is 199 */
-
- #define RASTERSIZE ((long)MAXCOLS * MAXROWS)
- #define MAXNUMGRAYCOLORS MAXQUANTLEVELS
-
- /* histogram equates */
- #define HISTOCOL 0
- #define HISTOROW 0
- #define HISTOWIDTH 134
- #define HISTOHEIGHT 84
-
- #define BLACK 0
- #define WHITE 63
-
- #define AXISCOL (HISTOCOL+3)
- #define AXISROW (HISTOROW+HISTOHEIGHT-5)
- #define AXISLENGTH MAXQUANTLEVELS*2-1
- #define DATACOL AXISCOL
- #define DATAROW AXISROW-1
- #define MAXDEFLECTION (HISTOHEIGHT-10)
-
- /* External Function Declarations and Prototypes */
-
- void CopyImage(BYTE huge *SourceBuf, BYTE huge *DestBuf);
-
- BYTE GetPixelFromImage(BYTE huge *Image, unsigned Col, unsigned Row);
-
- CompletionCode PutPixelInImage(BYTE huge *Image, unsigned Col,
- unsigned Row, unsigned Color);
-
- CompletionCode DrawHLine(BYTE huge *Image, unsigned Col, unsigned Row,
- unsigned Length, unsigned Color);
-
- CompletionCode DrawVLine(BYTE huge *Image, unsigned Col, unsigned Row,
- unsigned Length, unsigned Color);
-
- void ReadImageAreaToBuf (BYTE huge *Image, unsigned Col, unsigned Row,
- unsigned Width, unsigned Height,
- BYTE huge *Buffer);
-
- void WriteImageAreaFromBuf (BYTE huge *Buffer, unsigned BufWidth,
- unsigned BufHeight, BYTE huge *Image,
- unsigned ImageCol, unsigned ImageRow);
-
- void ClearImageArea(BYTE huge *Image,unsigned Col, unsigned Row,
- unsigned Width, unsigned Height,
- unsigned PixelValue);
-
- CompletionCode ParameterCheckOK(unsigned Col, unsigned Row,
- unsigned ColExtent, unsigned RowExtent,
- char *ErrorStr);
-
-