• 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: Thread safe?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread safe?


  • Subject: Re: Thread safe?
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 30 Mar 2008 10:02:31 -0700


On 30 Mar '08, at 8:34 AM, Trygve Inda wrote:

How did you work around this?

Basically I am opening a bitmap drawing an NSImage into it, then pixel-level
tweaking the bitmap, and saving it to disk as a jpg.

You might want to drop down a level and use CGImage for your bitmap. CG is stateless (the graphics context is passed in to every drawing call) and doesn't do the types of offscreen caching that NSImage does, so it's more likely to be thread-safe.


You can use Cocoa graphics calls to draw into GCImages ... the recipe was discussed here in the last week or two, though I don't remember the details. You need to get a CG graphics context for drawing into the image, then make it the current NSGraphicsContext. (The books on Quartz 2D graphics probably discuss this too.)

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Thread safe?
      • From: glenn andreas <email@hidden>
References: 
 >Re: Thread safe? (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: weak linking
  • Next by Date: Re: Thread safe?
  • Previous by thread: Re: Thread safe?
  • Next by thread: Re: Thread safe?
  • Index(es):
    • Date
    • Thread