The R Project SVN R

Rev

Rev 9184 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9184 Rev 31702
Line 24... Line 24...
24
   WITHOUT ANY WARRANTY.
24
   WITHOUT ANY WARRANTY.
25
 
25
 
26
   See the file COPYLIB.TXT for details.
26
   See the file COPYLIB.TXT for details.
27
*/
27
*/
28
 
28
 
-
 
29
/* Copyright (C) 2004 	The R Foundation
-
 
30
 
29
/* Changes for R:  allow 32 contexts not 4 */
31
      Changes for R:  allow 32 contexts not 4
-
 
32
      Remove assumption that current->dest is non-NULL
-
 
33
*/
30
 
34
 
31
#include "internal.h"
35
#include "internal.h"
32
 
36
 
33
/*
37
/*
34
 *  Private library variables.
38
 *  Private library variables.
Line 330... Line 334...
330
 
334
 
331
	r = (int) ((c >> 16) & 0x000000FFL);
335
	r = (int) ((c >> 16) & 0x000000FFL);
332
	g = (int) ((c >>  8) & 0x000000FFL);
336
	g = (int) ((c >>  8) & 0x000000FFL);
333
	b = (int) ((c >>  0) & 0x000000FFL);
337
	b = (int) ((c >>  0) & 0x000000FFL);
334
 
338
 
335
	depth = getdepth(current->dest);
339
	if (current->dest) depth = getdepth(current->dest);
-
 
340
	else depth = 2;  /* set default minimal depth if no current window */
336
 
341
 
337
	if (depth <= 2)	/* map to black or white, or grey if c == Grey */
342
	if (depth <= 2)	/* map to black or white, or grey if c == Grey */
338
	{
343
	{
339
		luminance = (r*3 + g*5 + b) / 9;
344
		luminance = (r*3 + g*5 + b) / 9;
340
		if (luminance > 0x0087)		r = g = b = 0x00FF;
345
		if (luminance > 0x0087)		r = g = b = 0x00FF;