summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvPs.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkCanvPs.c')
-rw-r--r--generic/tkCanvPs.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index e786a14..866433f 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvPs.c,v 1.14 2003/08/20 10:26:38 dkf Exp $
+ * RCS: @(#) $Id: tkCanvPs.c,v 1.15 2004/02/23 10:48:11 das Exp $
*/
#include "tkInt.h"
@@ -1134,7 +1134,13 @@ GetPostscriptPoints(interp, string, doublePtr)
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GetBValue(rgb) ((BYTE)((rgb)>>16))
*/
+#else
+#define GetRValue(rgb) ((rgb & cdata->red_mask) >> cdata->red_shift)
+#define GetGValue(rgb) ((rgb & cdata->green_mask) >> cdata->green_shift)
+#define GetBValue(rgb) ((rgb & cdata->blue_mask) >> cdata->blue_shift)
+#endif
+#if defined(WIN32) || defined(MAC_OSX_TK)
static void
TkImageGetColor(cdata, pixel, red, green, blue)
TkColormapData *cdata; /* Colormap data */
@@ -1153,9 +1159,9 @@ TkImageGetColor(cdata, pixel, red, green, blue)
double *red, *green, *blue; /* Color data to return */
{
if (cdata->separated) {
- int r = (pixel & cdata->red_mask) >> cdata->red_shift;
- int g = (pixel & cdata->green_mask) >> cdata->green_shift;
- int b = (pixel & cdata->blue_mask) >> cdata->blue_shift;
+ int r = GetRValue(pixel);
+ int g = GetGValue(pixel);
+ int b = GetBValue(pixel);
*red = cdata->colors[r].red / 65535.0;
*green = cdata->colors[g].green / 65535.0;
*blue = cdata->colors[b].blue / 65535.0;