diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:09 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:09 +0200 |
commit | 110fc5dee14fc7988f631a158e50d283446aba7a (patch) | |
tree | 7c19dfd3bdb8c4636409ec80a38c70499ac006db /lib/osx_file_icon.mm | |
parent | 5.14 (diff) | |
download | FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.gz FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.bz2 FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.zip |
5.15
Diffstat (limited to 'lib/osx_file_icon.mm')
-rw-r--r-- | lib/osx_file_icon.mm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/osx_file_icon.mm b/lib/osx_file_icon.mm index 6a068998..11fb053f 100644 --- a/lib/osx_file_icon.mm +++ b/lib/osx_file_icon.mm @@ -31,8 +31,8 @@ osx::ImageData extractBytes(NSImage* nsImg, int requestedSize) //throw OsxError; CGImageRef imgRef = [nsImg CGImageForProposedRect:&rectProposed context:nil hints:nil]; ZEN_OSX_ASSERT(imgRef != NULL); //can this fail? not documented; ownership?? not documented! - const size_t width = CGImageGetWidth (imgRef); - const size_t height = CGImageGetHeight(imgRef); + const size_t width = ::CGImageGetWidth (imgRef); + const size_t height = ::CGImageGetHeight(imgRef); ZEN_OSX_ASSERT(width > 0 && height > 0 && requestedSize > 0); @@ -46,14 +46,14 @@ osx::ImageData extractBytes(NSImage* nsImg, int requestedSize) //throw OsxError; trgHeight = height * requestedSize / maxExtent; } - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGColorSpaceRef colorSpace = ::CGColorSpaceCreateDeviceRGB(); ZEN_OSX_ASSERT(colorSpace != NULL); //may fail - ZEN_ON_SCOPE_EXIT(CGColorSpaceRelease(colorSpace)); + ZEN_ON_SCOPE_EXIT(::CGColorSpaceRelease(colorSpace)); std::vector<unsigned char> buf(trgWidth* trgHeight * 4); //32-bit ARGB, little endian byte order -> already initialized with 0 = fully transparent //supported color spaces: https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_context/dq_context.html#//apple_ref/doc/uid/TP30001066-CH203-BCIBHHBB - CGContextRef ctxRef = CGBitmapContextCreate(&buf[0], //void *data, + CGContextRef ctxRef = ::CGBitmapContextCreate(&buf[0], //void *data, trgWidth, //size_t width, trgHeight, //size_t height, 8, //size_t bitsPerComponent, @@ -61,9 +61,9 @@ osx::ImageData extractBytes(NSImage* nsImg, int requestedSize) //throw OsxError; colorSpace, //CGColorSpaceRef colorspace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); //CGBitmapInfo bitmapInfo ZEN_OSX_ASSERT(ctxRef != NULL); - ZEN_ON_SCOPE_EXIT(CGContextRelease(ctxRef)); + ZEN_ON_SCOPE_EXIT(::CGContextRelease(ctxRef)); - CGContextDrawImage(ctxRef, CGRectMake(0, 0, trgWidth, trgHeight), imgRef); //can this fail? not documented + ::CGContextDrawImage(ctxRef, CGRectMake(0, 0, trgWidth, trgHeight), imgRef); //can this fail? not documented //CGContextFlush(ctxRef); //"If you pass [...] a bitmap context, this function does nothing." |