diff options
author | das <das> | 2004-02-23 10:49:29 (GMT) |
---|---|---|
committer | das <das> | 2004-02-23 10:49:29 (GMT) |
commit | 297090b448fe798845d0a7c7e9427e9ef7dbc8ca (patch) | |
tree | b311d4d99e05537a622c27159bf7d6b0c74ef3a3 /generic/tkCanvPs.c | |
parent | 27f215c03a679ec897bd96a5fa2daa40fb42b7db (diff) | |
download | tk-297090b448fe798845d0a7c7e9427e9ef7dbc8ca.zip tk-297090b448fe798845d0a7c7e9427e9ef7dbc8ca.tar.gz tk-297090b448fe798845d0a7c7e9427e9ef7dbc8ca.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.
* generic/tkImgPhoto.c (ImgPhotoDisplay): enabled alpha blending
for images with partial transparency on MacOSX.
[Bug 809157]
Diffstat (limited to 'generic/tkCanvPs.c')
-rw-r--r-- | generic/tkCanvPs.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index e987b5d..667291b 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.13 2003/02/18 21:54:18 hobbs Exp $ + * RCS: @(#) $Id: tkCanvPs.c,v 1.13.2.1 2004/02/23 10:49:29 das Exp $ */ #include "tkInt.h" @@ -1137,7 +1137,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 */ @@ -1156,9 +1162,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; |