trouble getting black lines with linesmooth

RonCagenello at UCBVAX.BERKELEY.EDU RonCagenello at UCBVAX.BERKELEY.EDU
Fri Feb 22 01:55:11 AEST 1991


Using the manual's example to generate anti-aliased grey-scale
lines (in which 16 grey levels from black to white are
used to smooth the line) I have not been able to produce lines
of the two darkest grey levels.  This is the relevant code:

#define RMPBASE 64
#define RMPSIZE 16
#define RMPSTEP (255/(RMPSIZE-1))

for(i=0; i<RMPSIZE; i++)
	  mapcolor(i+RMPBASE, 255-i*RMPSTEP, 255-i*RMPSTEP, 255-i*RMPSTEP);
	
In the drawing routine:

subpixel(TRUE);
linesmooth(SML_ON);
color(RMPBASE);  /*background, white*/
clear();
color(RMPBASE+RMPSIZE-1); /*should be cmap entry 79, which has value 0,black*/
bgnline()...endline()

Visually, this gives a darkish grey line, and upon inspection with
rectread, the cmap entry used for black is 77, never 79, even when
explicitly set. 77 corresponds to a grey level two increments lighter
than black, and so the contrast of the resulting line is less than it
could be.  

I use a Personal Iris running 3.3, and colormap mode in this example.
Any insights would be appreciated.

Ron Cagenello
The Lighthouse (Low Vision Research)
rbc at xp.psych.edu



More information about the Comp.sys.sgi mailing list