Re: Best format and method for very fast CGImage resizing [Solved]
Re: Best format and method for very fast CGImage resizing [Solved]
- Subject: Re: Best format and method for very fast CGImage resizing [Solved]
- From: Ken Tozier <email@hidden>
- Date: Mon, 23 Apr 2007 20:05:57 -0400
On Apr 23, 2007, at 4:18 PM, David Duncan wrote:
On Apr 22, 2007, at 1:07 PM, Ken Tozier wrote:
As it stands now, I create the thumbnails as a CGImages inside a
CGUtilCreateBitmapContext. Should I convert them to CIImages?
NSImages? From there, what would be faster: An affine transform in
the draw method? Or a CIImage transform?
The biggest win won't so much be from which method you use to store
your thumbnails, as how you decide to store them. If you draw
thumbnails as just a scaling down of the original image every time,
then you will see fairly poor performance. If you have a maximum
size for your thumbnails, preprocessing them into that maximum size
from the originals will increase your performance greatly. If
quality is a concern (and when isn't it!) then always make sure
that you are scaling down rather than up.
From the pure CoreGraphics side of things, a CGImage or CGLayer
would be the best way to store the thumbnails. CIImages don't store
images so much as instructions for creating an image, so you will
have to have your images in a CGImage or CGLayer before you could
pass it to Core Image anyway (although Core Image may provide you
with better scaling algorithms and better performance in general if
it can work entirely on the video card).
Just to see what happens, I tried an affine transform on the
CGContext and it turned out to be plenty fast. I can zoom and shrink
100 page thumbnails with no observable lag so that's good enough for me.
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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