• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bitmaps, colorspaces, etc.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bitmaps, colorspaces, etc.


  • Subject: Re: Bitmaps, colorspaces, etc.
  • From: Graham Cox <email@hidden>
  • Date: Mon, 21 Dec 2015 17:57:45 +1100

> On 21 Dec 2015, at 1:16 PM, Roland King <email@hidden> 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 (email@hidden)

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:

This email sent to email@hidden


References: 
 >Bitmaps, colorspaces, etc. (From: Graham Cox <email@hidden>)
 >Re: Bitmaps, colorspaces, etc. (From: Roland King <email@hidden>)

  • Prev by Date: Re: Bitmaps, colorspaces, etc.
  • Next by Date: Re: Bitmaps, colorspaces, etc.
  • Previous by thread: Re: Bitmaps, colorspaces, etc.
  • Next by thread: Re: Bitmaps, colorspaces, etc.
  • Index(es):
    • Date
    • Thread