Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User Spaces vs. Generic Spaces




On May 17, 2005, at 11:21 AM, Andrew Kimpton wrote:
Ok - so if I have a CGImage in my left hand that is in the sRGB colorspace, and I have a CGContext pointing at the display with the generic colorspace (or DeviceRGB) in my right hand. Every time I draw the image from left to right I incur a performance hit for the color space transform ?

Yes.

However if I insert an intermediate CGImage/CGBitmapContext combo with a colorspace matching the displays CGContext and draw the image once to the intermediate (incurring the performance hit one time only) I can draw that intermediate multiple times later without incurring the hit ?

Yes.  You draw into the bitmap context and that causes the color matching to happen once.  You then create a new image from the result.  If you draw that new image then you won't incur the matching hit. 

That's why it's best to use the monitor profile if you know you'll be drawing to a window.  If you use the generic color space, you may still incur an offscreen-to-monitor matching step.

I'm actually already doing something very close to this since the original CGImage comes from a 'PNG Data Provider' which is slow if you draw it multiple times (disk rereads - an issue mentioned here in the past). Since my images aren't color corrected I can only assume that somewhere along the line the sRGB colorspace info is either not present, being ignored, or being overwritten by a colorspace set by my own code.

If the PNG is tagged with a color space then the ColorSync utility will let you know.  Open that image with the ColorSync utility and do get info on it.  It will tell you what color space is attached to the image.

Scott

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden

References: 
 >User Spaces vs. Generic Spaces (From: "R. Scott Thompson" <email@hidden>)
 >Re: User Spaces vs. Generic Spaces (From: Brendan Younger <email@hidden>)
 >Re: User Spaces vs. Generic Spaces (From: Haroon Sheikh <email@hidden>)
 >Re: User Spaces vs. Generic Spaces (From: Andrew Kimpton <email@hidden>)
 >Re: User Spaces vs. Generic Spaces (From: Scott Thompson <email@hidden>)
 >Re: User Spaces vs. Generic Spaces (From: Andrew Kimpton <email@hidden>)
 >Re: User Spaces vs. Generic Spaces (From: Scott Thompson <email@hidden>)
 >Re: User Spaces vs. Generic Spaces (From: Andrew Kimpton <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.