Non-deprecated replacement for NSCalibratedBlackColorSpace?

Posted by uliwitness on Stack Overflow See other posts from Stack Overflow or by uliwitness
Published on 2010-04-10T13:03:36Z Indexed on 2010/04/10 13:33 UTC
Read the original article Hit count: 215

Filed under:
|
|
|
|

I'm implementing my own NSBitmapImageRep (to draw PBM image files). To draw them, I'm using NSDrawBitmap() and passing it the NSCalibratedBlackColorSpace (as the bits are 1 for black, 0 for white).

Trouble is, I get the following warning:

warning: 'NSCalibratedBlackColorSpace' is deprecated

However, I couldn't find a good replacement for it. NSCalibratedWhiteColorSpace gives me an inverted image, and there seems to be no way to get NSDrawBitmap() to use a CGColorSpaceRef or NSColorSpace that I could create as a custom equivalent to NSCalibratedBlackColorSpace.

I've found a (hacky) way to shut up the warning (so I can still build warning-free until a replacement becomes available) by just passing @"NSCalibratedBlackColorSpace" instead of the symbolic constant, but I'd rather apply a correct fix.

Anybody have an idea?

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about objective-c