aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-03-08 03:25:26 +0000
committerYAMAMOTO Mitsuharu2006-03-08 03:25:26 +0000
commit4cdffedfae096a34769f29b455ecc3a78f13fa24 (patch)
treeae721e733dbe430f0af2b203dd28bc87218702ee /src/image.c
parent4299d849d878519b010c9a0638674673b2482538 (diff)
downloademacs-4cdffedfae096a34769f29b455ecc3a78f13fa24.tar.gz
emacs-4cdffedfae096a34769f29b455ecc3a78f13fa24.zip
[MAC_OS] (XPutPixel): Set alpha channel bits if pixmap depth is 32.
[MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap depth is 32.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/image.c b/src/image.c
index 879bbf745a3..cbdff81eba7 100644
--- a/src/image.c
+++ b/src/image.c
@@ -194,7 +194,7 @@ XPutPixel (ximage, x, y, pixel)
194 char *base_addr = GetPixBaseAddr (pixmap); 194 char *base_addr = GetPixBaseAddr (pixmap);
195 short row_bytes = GetPixRowBytes (pixmap); 195 short row_bytes = GetPixRowBytes (pixmap);
196 196
197 ((unsigned long *) (base_addr + y * row_bytes))[x] = pixel; 197 ((unsigned long *) (base_addr + y * row_bytes))[x] = 0xff000000 | pixel;
198 } 198 }
199 else if (depth == 1) 199 else if (depth == 1)
200 { 200 {
@@ -238,7 +238,7 @@ XGetPixel (ximage, x, y)
238 char *base_addr = GetPixBaseAddr (pixmap); 238 char *base_addr = GetPixBaseAddr (pixmap);
239 short row_bytes = GetPixRowBytes (pixmap); 239 short row_bytes = GetPixRowBytes (pixmap);
240 240
241 return ((unsigned long *) (base_addr + y * row_bytes))[x]; 241 return ((unsigned long *) (base_addr + y * row_bytes))[x] & 0x00ffffff;
242 } 242 }
243 else if (depth == 1) 243 else if (depth == 1)
244 { 244 {