diff options
| author | Pietro Gagliardi <[email protected]> | 2015-02-18 23:04:14 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-02-18 23:04:14 -0500 |
| commit | 1d091637d8a958b648fe77dd1ce5a9760737dfc1 (patch) | |
| tree | 10126d366e05ed7328b60fe9149d6ac79a2b5904 /imagelist_darwin.m | |
| parent | 8ec518dfe8813feebf8a408113499ec54254927a (diff) | |
Migrated the Mac OS X Table implementation. Untested due to VM issues.
Diffstat (limited to 'imagelist_darwin.m')
| -rw-r--r-- | imagelist_darwin.m | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/imagelist_darwin.m b/imagelist_darwin.m deleted file mode 100644 index 7433b12..0000000 --- a/imagelist_darwin.m +++ /dev/null @@ -1,30 +0,0 @@ -// 16 august 2014 - -#import "objc_darwin.h" -#import <Cocoa/Cocoa.h> - -#define toNSInteger(x) ((NSInteger) (x)) - -id toImageListImage(void *pixels, intptr_t width, intptr_t height, intptr_t stride) -{ - NSBitmapImageRep *bitmap; - NSImage *image; - - // we can't just hand it pixels; we need to make a copy - bitmap = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes:NULL - pixelsWide:toNSInteger(width) - pixelsHigh:toNSInteger(height) - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSDeviceRGBColorSpace - bitmapFormat:0 - bytesPerRow:toNSInteger(stride) - bitsPerPixel:32]; - memcpy((void *) [bitmap bitmapData], pixels, [bitmap bytesPerPlane]); - image = [[NSImage alloc] initWithSize:NSMakeSize((CGFloat) width, (CGFloat) height)]; - [image addRepresentation:bitmap]; - return (id) image; -} |
