summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-11 16:17:06 -0400
committerPietro Gagliardi <[email protected]>2014-04-11 16:17:06 -0400
commit5581d41f88ebaa36ce4a01c4b9c52f7e8abd4bf8 (patch)
tree6e2fdc2cd7d492b301f3677597ada68dec073bbe
parent6f0d114a8b2557e89a56480ed5f69edd3853b282 (diff)
Switched to alpha-premultiplied image data for Areas on Mac OS X. This is the easiest change; it involves removing one bit flag from the NSBitmapImageRep constructor (the other changes are indentation changes).
-rw-r--r--bleh_darwin.m22
1 files changed, 11 insertions, 11 deletions
diff --git a/bleh_darwin.m b/bleh_darwin.m
index 8653e74..f21d55c 100644
--- a/bleh_darwin.m
+++ b/bleh_darwin.m
@@ -270,17 +270,17 @@ void drawImage(void *pixels, int64_t width, int64_t height, int64_t stride, int6
bitmap = objc_msgSend(c_NSBitmapImageRep, s_alloc);
planes[0] = (unsigned char *) pixels;
bitmap = objc_msgSend(bitmap, s_initWithBitmapDataPlanes,
- planes, /* initWithBitmapDataPlanes: */
- (NSInteger) width, /* pixelsWide: */
- (NSInteger) height, /* pixelsHigh: */
- (NSInteger) 8, /* bitsPerSample: */
- (NSInteger) 4, /* samplesPerPixel: */
- (BOOL) YES, /* hasAlpha: */
- (BOOL) NO, /* isPlanar: */
- NSCalibratedRGBColorSpace, /* colorSpaceName: | TODO NSDeviceRGBColorSpace? */
- (NSBitmapFormat) NSAlphaNonpremultipliedBitmapFormat, /* bitmapFormat: | this is where the flag for placing alpha first would go if alpha came first; the default is alpha last, which is how we're doing things (otherwise the docs say "Color planes are arranged in the standard order—for example, red before green before blue for RGB color.") */
- (NSInteger) stride, /* bytesPerRow: */
- (NSInteger) 32); /* bitsPerPixel: */
+ planes, /* initWithBitmapDataPlanes: */
+ (NSInteger) width, /* pixelsWide: */
+ (NSInteger) height, /* pixelsHigh: */
+ (NSInteger) 8, /* bitsPerSample: */
+ (NSInteger) 4, /* samplesPerPixel: */
+ (BOOL) YES, /* hasAlpha: */
+ (BOOL) NO, /* isPlanar: */
+ NSCalibratedRGBColorSpace, /* colorSpaceName: | TODO NSDeviceRGBColorSpace? */
+ (NSBitmapFormat) 0, /* bitmapFormat: | this is where the flag for placing alpha first would go if alpha came first; the default is alpha last, which is how we're doing things (otherwise the docs say "Color planes are arranged in the standard order—for example, red before green before blue for RGB color."); this is also where the flag for non-premultiplied colors would go if we used it (the default is alpha-premultiplied) */
+ (NSInteger) stride, /* bytesPerRow: */
+ (NSInteger) 32); /* bitsPerPixel: */
/* TODO this CAN fail; check error */
objc_msgSend_drawInRect(bitmap, s_drawInRect,
NSMakeRect((CGFloat) xdest, (CGFloat) ydest,