From 77bf566ebbcb62acd4d08d905d9542d6ff9b6b80 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 30 Aug 2014 23:02:02 -0400 Subject: ...in with the new. --- redo/imagelist_darwin.m | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 redo/imagelist_darwin.m (limited to 'redo/imagelist_darwin.m') diff --git a/redo/imagelist_darwin.m b/redo/imagelist_darwin.m deleted file mode 100644 index 7433b12..0000000 --- a/redo/imagelist_darwin.m +++ /dev/null @@ -1,30 +0,0 @@ -// 16 august 2014 - -#import "objc_darwin.h" -#import - -#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; -} -- cgit v1.2.3