Back to index

radiance  4R0+20100331
rast.h
Go to the documentation of this file.
00001 /* RCSid: $Id: rast.h,v 1.2 2003/07/14 22:24:00 schorsch Exp $ */
00002 /*
00003  *   Structures for line segment output to raster files
00004  */
00005 #ifndef _RAD_RAST_H_
00006 #define _RAD_RAST_H_
00007 
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011 
00012 #define  NUMSCANS    16            /* number of scanlines per block */
00013 
00014 typedef struct {                   /* raster scanline block */
00015              unsigned char  *cols[NUMSCANS];
00016              int  ybot, ytop;                    /* ybot is scan[0] */
00017              int  xleft, xright;
00018              int  width;
00019              } SCANBLOCK;
00020 
00021 extern int  ydown;                 /* y going down? */
00022 
00023 extern int  minwidth;                     /* minimum line width */
00024 
00025 extern SCANBLOCK  outblock;        /* output span */
00026 
00027 #define  IBLK 0             /* index for black */
00028 #define  IRED 1
00029 #define  IGRN 2
00030 #define  IBLU 3
00031 #define  IYEL 4
00032 #define  IMAG 5
00033 #define  ICYN 6
00034 #define  IWHT 7
00035 
00036 #define  pixtog(x,y,c)      { register unsigned char \
00037               *cp = outblock.cols[(y)-outblock.ybot]+(x); \
00038               *cp = ((~*cp ^ (c)<<3)&070) | (*cp&07); }
00039 
00040 #define  pixmix(x,y,c)      (outblock.cols[(y)-outblock.ybot][x] &= 070|(c))
00041 
00042 #define  someabove(p,y)     (CONV((p)->xy[YMX],dysize) > (y))
00043 #define  somebelow(p,y)     (CONV((p)->xy[YMN],dysize) < (y))
00044 
00045 #define  inthis(p)   (ydown ? someabove(p,outblock.ybot-1) : \
00046                             somebelow(p,outblock.ytop+1))
00047 #define  innext(p)   (ydown ? somebelow(p,outblock.ybot) : \
00048                             someabove(p,outblock.ytop))
00049 
00050 #ifdef __cplusplus
00051 }
00052 #endif
00053 #endif /* _RAD_RAST_H_ */
00054