diff options
| author | Pietro Gagliardi <[email protected]> | 2015-12-11 20:37:59 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-12-11 20:37:59 -0500 |
| commit | f8e3f12ab02b528f2a05a4f713d7af7ea8e44b42 (patch) | |
| tree | 82dedf4d37f0f6d31e88ebb2ca1ce6499dead261 /image_darwin.m | |
| parent | e34c561ed5bedeb180437ec165882b98d70d38c1 (diff) | |
LET'S GET THIS FINAL REWRITE EVER STARTED
Diffstat (limited to 'image_darwin.m')
| -rw-r--r-- | image_darwin.m | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/image_darwin.m b/image_darwin.m deleted file mode 100644 index 1b77e22..0000000 --- a/image_darwin.m +++ /dev/null @@ -1,31 +0,0 @@ -// 16 august 2014 - -#import "objc_darwin.h" -#import <Cocoa/Cocoa.h> - -#define toNSInteger(x) ((NSInteger) (x)) - -id toTableImage(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]; - // TODO release bitmap? - return (id) image; -} |
