> On 21 Dec 2015, at 1:16 PM, Roland King <r...@rols.org> wrote:
> 
> That bit seems straightforward, you get the CGColorSpace property of the 
> NSColorSpace object returned by NSColorSpace.availableColorSpacesWithModel() 
> 
> But if you want a bitmap to draw in then CGImageRef doesn’t seem like the 
> right thing, CGBitmapContext takes a CGColorSpace (as long as it’s not an 
> indexed one). If you need to bridge back to NSBitmapImageRef you should be 
> able to do that via the CGBitmapContext’s CGImage property which is probably 
> more efficient than you might fear. 

Great, I’m making some headway now. Thanks!

I’m not sure why I’d overlooked CGBitmapContextCreate - I guess having used the 
CGImageCreate stuff in the past I assumed that was the only API that created a 
raw image buffer in CG. Indeed, the CGBitmapContext kills several birds with 
one stone, and seems to work efficiently. I don’t need indexed colorspaces, 
RGB, CMYK and Gray are plenty enough.

—Graham



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to