| 1 |
< |
/* Copyright (c) 1990 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1997 Regents of the University of California */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
|
| 112 |
< |
colortrans(c2, mat, c1) /* convert c1 by mat and put into c2 */ |
| 112 |
> |
colortrans(c2, mat, c1, noneg) /* convert c1 by mat and put into c2 */ |
| 113 |
|
register COLORMAT mat; |
| 114 |
|
register COLOR c1, c2; |
| 115 |
+ |
int noneg; |
| 116 |
|
{ |
| 117 |
|
static float cout[3]; |
| 118 |
|
|
| 119 |
|
cout[0] = mat[0][0]*c1[0] + mat[0][1]*c1[1] + mat[0][2]*c1[2]; |
| 120 |
|
cout[1] = mat[1][0]*c1[0] + mat[1][1]*c1[1] + mat[1][2]*c1[2]; |
| 121 |
|
cout[2] = mat[2][0]*c1[0] + mat[2][1]*c1[1] + mat[2][2]*c1[2]; |
| 122 |
< |
if((c2[0] = cout[0]) < 0.) c2[0] = 0.; |
| 123 |
< |
if((c2[1] = cout[1]) < 0.) c2[1] = 0.; |
| 124 |
< |
if((c2[2] = cout[2]) < 0.) c2[2] = 0.; |
| 122 |
> |
if (!noneg) |
| 123 |
> |
return; |
| 124 |
> |
if ((c2[0] = cout[0]) < 0.) c2[0] = 0.; |
| 125 |
> |
if ((c2[1] = cout[1]) < 0.) c2[1] = 0.; |
| 126 |
> |
if ((c2[2] = cout[2]) < 0.) c2[2] = 0.; |
| 127 |
|
} |
| 128 |
|
|
| 129 |
|
|