...
|
...
|
@@ -33,9 +33,6 @@ |
|
|
|
|
|
if (anyAlpha) { return image; }
|
|
|
|
|
|
size_t width = CGImageGetWidth(imageRef);
|
|
|
size_t height = CGImageGetHeight(imageRef);
|
|
|
|
|
|
// current
|
|
|
CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(CGImageGetColorSpace(imageRef));
|
|
|
CGColorSpaceRef colorspaceRef = CGImageGetColorSpace(imageRef);
|
...
|
...
|
@@ -44,10 +41,17 @@ |
|
|
if (unsupportedColorSpace)
|
|
|
colorspaceRef = CGColorSpaceCreateDeviceRGB();
|
|
|
|
|
|
CGContextRef context = CGBitmapContextCreate(NULL, width,
|
|
|
size_t width = CGImageGetWidth(imageRef);
|
|
|
size_t height = CGImageGetHeight(imageRef);
|
|
|
NSUInteger bytesPerPixel = 4;
|
|
|
NSUInteger bytesPerRow = bytesPerPixel * width;
|
|
|
NSUInteger bitsPerComponent = 8;
|
|
|
|
|
|
CGContextRef context = CGBitmapContextCreate(NULL,
|
|
|
width,
|
|
|
height,
|
|
|
CGImageGetBitsPerComponent(imageRef),
|
|
|
0,
|
|
|
bitsPerComponent,
|
|
|
bytesPerRow,
|
|
|
colorspaceRef,
|
|
|
kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst);
|
|
|
|
...
|
...
|
|