Anti-aliased black lines?

RonCagenello at UCBVAX.BERKELEY.EDU RonCagenello at UCBVAX.BERKELEY.EDU
Fri Mar 1 01:54:24 AEST 1991


Either the answer to this query was so simple that you all thought
someone else would answer it, or nobody knows the remedy!  Here's
my question again...

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);
/*at index 64, grey scale is 255, white, at index 79, it's 0, black*/
	
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