Re: fast bitmap image scaling
Re: fast bitmap image scaling
- Subject: Re: fast bitmap image scaling
- From: "douglas a. welton" <email@hidden>
- Date: Wed, 10 Jan 2007 17:13:29 -0500
Ben,
Have you tried playing with CIImages and the CIFilter
CILanczosScaleTransform?
curiously,
douglas
On Jan 10, 2007, at 4:03 PM, Ben Zotto wrote:
Hi all,
I'm relatively new to the graphics end of the Mac platform, and I'm
looking for pointers for optimizing some drawing I'm doing. I am
working an NSImage composited into a custom view. I am user a
timer to animate the image to grow from relatively small to
relatively large in the view. It works, but the resizing is
"chunky" at best. The image I'm using is of a pretty low
resolution-- with its size set to the pixel size of the underlying
bitmap-- and interpolation is set to None in the graphics context
while this is happening. I'm drawing using NSImage's drawInRect:
method, supplying larger and larger target rectangles. Shark
doesn't tell me much that I can work with except that I'm spending
a lot of time in CGContextDrawImage and its callees.
The quality of the scaling while it's animating is absolutely
immaterial-- it can look terrible as long as it looks smooth. Now,
I know that modern graphics hardware can do wickedly fast bitmap
scaling (witness Expose's F9 function). So is anyone kind enough
to toss out any collected wisdom about this subject, and possible
subtle roadblocks that could be slowing me down? I don't know
anything about colorspaces, should I learn more about them? I'm
certainly willing to drop directly to Quartz calls if it might
help, or even manipulate pixels/texels directly, if what I'm trying
to do just isn't easy at the Cocoa level, but I don't want to go
off on a wild goose chase if there's something else fundamentally off.
Thanks for any thoughts, techniques, pointers, etc.
Cheers
Ben
_______________________________________________
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