HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from emacs-24; up to 2012-12-30T19:34:25Z!jan.h.d@swipnet.se
[bpt/emacs.git]
/
src
/
nsimage.m
diff --git
a/src/nsimage.m
b/src/nsimage.m
index
370cf83
..
a170327
100644
(file)
--- a/
src/nsimage.m
+++ b/
src/nsimage.m
@@
-1,6
+1,6
@@
/* Image support for the NeXT/Open/GNUstep and MacOSX window system.
/* Image support for the NeXT/Open/GNUstep and MacOSX window system.
- Copyright (C) 1989, 1992-1994, 2005-2006, 2008-201
2
-
Free Software
Foundation, Inc.
+ Copyright (C) 1989, 1992-1994, 2005-2006, 2008-201
3 Free Software
+ Foundation, Inc.
This file is part of GNU Emacs.
This file is part of GNU Emacs.
@@
-334,7
+334,7
@@
static EmacsImage *ImageList = nil;
{
NSSize s = [self size];
unsigned char *planes[5];
{
NSSize s = [self size];
unsigned char *planes[5];
- CGFloat r, g, b, a;
+
Emacs
CGFloat r, g, b, a;
NSColor *rgbColor;
if (bmRep == nil || color == nil)
NSColor *rgbColor;
if (bmRep == nil || color == nil)
@@
-403,7
+403,6
@@
static EmacsImage *ImageList = nil;
if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)])
{
bmRep = (NSBitmapImageRep *) rep;
if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)])
{
bmRep = (NSBitmapImageRep *) rep;
- onTiger = [bmRep respondsToSelector: @selector (colorAtX:y:)];
if ([bmRep numberOfPlanes] >= 3)
[bmRep getBitmapDataPlanes: pixmapData];
if ([bmRep numberOfPlanes] >= 3)
[bmRep getBitmapDataPlanes: pixmapData];
@@
-435,17
+434,16
@@
static EmacsImage *ImageList = nil;
| (pixmapData[0][loc] << 16) | (pixmapData[1][loc] << 8)
| (pixmapData[2][loc]);
}
| (pixmapData[0][loc] << 16) | (pixmapData[1][loc] << 8)
| (pixmapData[2][loc]);
}
- else
if (onTiger)
+ else
{
NSColor *color = [bmRep colorAtX: x y: y];
{
NSColor *color = [bmRep colorAtX: x y: y];
- CGFloat r, g, b, a;
+
Emacs
CGFloat r, g, b, a;
[color getRed: &r green: &g blue: &b alpha: &a];
return ((int)(a * 255.0) << 24)
| ((int)(r * 255.0) << 16) | ((int)(g * 255.0) << 8)
| ((int)(b * 255.0));
}
[color getRed: &r green: &g blue: &b alpha: &a];
return ((int)(a * 255.0) << 24)
| ((int)(r * 255.0) << 16) | ((int)(g * 255.0) << 8)
| ((int)(b * 255.0));
}
- return 0;
}
- (void) setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r
}
- (void) setPixelAtX: (int)x Y: (int)y toRed: (unsigned char)r
@@
-463,7
+461,7
@@
static EmacsImage *ImageList = nil;
pixmapData[2][loc] = b;
pixmapData[3][loc] = a;
}
pixmapData[2][loc] = b;
pixmapData[3][loc] = a;
}
- else
if (onTiger)
+ else
{
[bmRep setColor:
[NSColor colorWithCalibratedRed: (r/255.0) green: (g/255.0)
{
[bmRep setColor:
[NSColor colorWithCalibratedRed: (r/255.0) green: (g/255.0)
@@
-483,7
+481,7
@@
static EmacsImage *ImageList = nil;
pixmapData[3][loc] = a;
}
pixmapData[3][loc] = a;
}
- else
if (onTiger)
+ else
{
NSColor *color = [bmRep colorAtX: x y: y];
color = [color colorWithAlphaComponent: (a / 255.0)];
{
NSColor *color = [bmRep colorAtX: x y: y];
color = [color colorWithAlphaComponent: (a / 255.0)];