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: Questions about CGImage



I am new to this mailing list and to Quartz in general. I have taken on the big task of trying to recreate (as much as possible of) iPhoto's main thumbnail view. Up until now, I've been working with NSBitmapImageRep's under Cocoa. Even though that already yielded nice results in speed, I am sure that it can still be improved.

I tried to change my drawing parts to Quartz 2D. However, this produced a noticeably SLOWER execution. I used Shark on both versions and realized that obviously my Quartz version constantly re-loads the JPEG data.

NSImage will cache the bitmap representation of a JPEG as part of the NSImage. I don't believe that Quartz does that. You will probably get better performance if you cache the images yourself.

One way to do that would be to create an offscreen bitmap and draw the image from the JPEG into the offscreen bitmap context. Then you can create another CGImage from the pixels of the offscreen context and use it.

For the best performance, be sure that your offscreen bitmap uses the same color space as your display (I believe you can get that color space from CGColorSpaceCreateWithName(kCGColorSpaceUserRGB)?)

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: 
 >Questions about CGImage (From: Michael Becker <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.