On May 16, 2005, at 2:39 PM, Scott Thompson wrote:
Your best bet would be to read the images and perform the color
management on them once, then repeatedly draw the modified
images. There are several strategies you might take to do this.
If you support 10.3 and above, you can probably get away with
using CGImageCreateCopyWithColorSpace. As you read in each
image, create a copy and change the color space to the generic
RGB space, or the color space of your monitor.
10.3 is our minimum, so this sounds like the best trick to
avoiding the performance hit.
Now that I read what I wrote again, this is precisely the wrong
idea. (Sorry!)
What you want to do is color match the image from sRGB to the
monitor or generic rgb color space. This routine is just going to
give you a copy of the image with the color space object replaced
with the one you pass in. That's not going to color match the
image at all! (what was I thinking)
You'll probably have to do the "redraw the image into a bitmap"
thing to get Quartz to color match the data for you.
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 ?
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 ?
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.
Scott
Andre w8-)
_______________________________________________
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