summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordas <das>2004-02-23 10:48:09 (GMT)
committerdas <das>2004-02-23 10:48:09 (GMT)
commit424068d0e8dd6fcb04ef498c011262dd8466f3b5 (patch)
tree8af091f49a419ae3eaa1eefd6d0e21df85524f33 /generic
parent326d3447f96c8bbd0e2f1956eddfc532ab6a0853 (diff)
downloadtk-424068d0e8dd6fcb04ef498c011262dd8466f3b5.zip
tk-424068d0e8dd6fcb04ef498c011262dd8466f3b5.tar.gz
tk-424068d0e8dd6fcb04ef498c011262dd8466f3b5.tar.bz2
* macosx/tkMacOSXDraw.c:
* macosx/tkMacOSXXStubs.c: * xlib/ximage.c: fixed MacOSX XGetImage/XPutImage and related functions to deal properly with XImages copied from screen. * generic/tkCanvPs.c (TkImageGetColor): MacOSX fix. [Bug 809157]
Diffstat (limited to 'generic')
-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;