ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/aed.c
(Generate patch)

Comparing ray/src/rt/aed.c (file contents):
Revision 1.2 by greg, Mon Oct 2 17:12:34 1989 UTC vs.
Revision 1.6 by greg, Mon Jan 8 15:15:15 1990 UTC

# Line 46 | Line 46 | static char SCCSid[] = "$SunId$ LBL";
46   #define string(s)       fputs(s, stdout)
47   #define flush()         fflush(stdout)
48  
49 < #define  GAMMA          2.2             /* exponent for color correction */
49 > #define  GAMMA          2.5             /* exponent for color correction */
50  
51 < #define  NCOLORS        244             /* our color table size */
51 > #define  NCOLORS        248             /* our color table size */
52   #define  MINPIX         8               /* minimum hardware color */
53  
54   #define  NCOLS          512             /* maximum # columns for output */
55 < #define  NROWS          512-COMHT       /* maximum # rows for output */
55 > #define  NROWS          483-COMHT       /* maximum # rows for output */
56   #define  COMHT          16              /* height of command line */
57   #define  COMCW          63              /* maximum chars on command line */
58  
59 static COLR  colrmap[256];              /* our color map */
60
61 static COLR  colrtbl[NCOLORS];          /* our color table */
62
63 static int  colres = 64;                /* color resolution */
64
59   int  aed_close(), aed_clear(), aed_paintr(),
60                  aed_getcur(), aed_comout(), aed_errout();
61  
62   static struct driver  aed_driver = {
63          aed_close, aed_clear, aed_paintr, aed_getcur,
64          aed_comout, NULL,
65 <        NCOLS, NROWS
65 >        1.0, NCOLS, NROWS
66   };
67  
68  
69   struct driver *
70 < aed_init(name)                          /* open AED */
71 < char  *name;
70 > aed_init(name, id)                      /* open AED */
71 > char  *name, *id;
72   {
73          if (ttyset(&aed_driver, fileno(stdin)) < 0) {   /* set tty driver */
74                  stderr_v("cannot access terminal\n");
# Line 92 | Line 86 | char  *name;
86          byte(BLK); byte(WHT); byte(15);
87          command(SCP);
88          byte('+'); byte(0); byte(1);
89 <        make_cmap(GAMMA);                               /* make color map */
89 >        make_gmap(GAMMA);                               /* make color map */
90          errvec = aed_errout;                            /* set error vector */
91          cmdvec = aed_errout;
92          if (wrnvec != NULL)
# Line 123 | Line 117 | aed_clear(x, y)                                        /* clear AED */
117   int  x, y;
118   {
119          command(FFD);
120 <        maketab();                              /* init color table */
121 <        longwait(1);
120 >        new_ctab(NCOLORS);                      /* init color table */
121 >        flush();
122   }
123  
124  
# Line 133 | Line 127 | aed_paintr(col, xmin, ymin, xmax, ymax)                /* paint a re
127   COLOR  col;
128   int  xmin, ymin, xmax, ymax;
129   {
130 <        command(SEC);                                   /* draw rectangle */
131 <        byte(get_pixel(col)+MINPIX);
130 >        extern int  anewcolr();
131 >        int  ndx;
132 >
133 >        ndx = get_pixel(col, anewcolr);         /* calls anewcolr() */
134 >        command(SEC);                           /* draw rectangle */
135 >        byte(ndx+MINPIX);
136          aedsetcap(xmin, ymin+COMHT);
137          command(DFR);
138          aedcoord(xmax-1, ymax+(-1+COMHT));
# Line 253 | Line 251 | int  *xp, *yp;
251  
252  
253   static
254 < maketab()                               /* reinitialize the color table */
254 > anewcolr(index, r, g, b)                /* enter a color into our table */
255 > int  index;
256 > int  r, g, b;
257   {
258 <        extern COLR  *get_ctab();
259 <        register COLR  *ctab;
260 <        register int  i;
261 <
262 <        ctab = get_ctab(NCOLORS);       /* get colors */
263 <        command(SCT);                   /* set color table */
264 <        byte(MINPIX);                   /* starting index */
265 <        byte(NCOLORS&255);              /* number of colors (0==256) */
266 <        for (i = 0; i < NCOLORS; i++) {
267 <                byte(ctab[i][RED]);
268 <                byte(ctab[i][GRN]);
269 <                byte(ctab[i][BLU]);
270 <        }
258 >        command(SCT);
259 >        byte((index+MINPIX)&255);
260 >        byte(1);
261 >        byte(r);
262 >        byte(g);
263 >        byte(b);
264 >        flush();
265   }
266  
267  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines