diff options
| author | Pietro Gagliardi <[email protected]> | 2016-05-30 00:14:46 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2016-05-30 00:14:46 -0400 |
| commit | 52f7d276a6bb04b8827ac019ad1e135b43819cea (patch) | |
| tree | 5f0ebbfdf5885ef832e77e243b5916e59f46ba18 /prev/image_darwin.m | |
| parent | c9b32c1333e4009b342eedc5f5b39127a724fb42 (diff) | |
Removed prev/.
Diffstat (limited to 'prev/image_darwin.m')
| -rw-r--r-- | prev/image_darwin.m | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/prev/image_darwin.m b/prev/image_darwin.m deleted file mode 100644 index 1b77e22..0000000 --- a/prev/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; -} |
