Re: Fast image loading + scrolling like iPhoto
Re: Fast image loading + scrolling like iPhoto
- Subject: Re: Fast image loading + scrolling like iPhoto
- From: Shawn Erickson <email@hidden>
- Date: Wed, 5 Jan 2005 08:59:32 -0800
On Jan 5, 2005, at 8:16 AM, Ricky Sharp wrote:
On Jan 5, 2005, at 9:05 AM, Florian Soenens wrote:
i posted this message a week ago but got no response, perhaps because
of the holidays. So, here i go again:
Does anyone know how to reproduce the fast image loading and
scrolling that iPhoto 4 has? I mean, displaying a low res version
while scrolling and resizing is one thing, but how does one implement
this? What could be the tricks behind this?
For now, I have created my own custom row/column view that works
great, like the way it was in previous versions of iPhoto, but i am
eager to learn the technique used to create that damn fast loading,
scrolling and even resizing.
Any suggestions or experiences?
I believe iPhoto uses OpenGL. During scrolling, output quality is
decreased so that rendering time is greatly reduced. It's probably
some trick with textures. Someone that actually has dealt with OpenGL
(I never have myself) will know for sure.
Looking at iPhoto in shark it looks like they are simply drawing the
images using CGContextDrawImage and the trigger for drawing appears to
come out of a call to drawRect:clip: for an NSView (the have some code
in between it looks like). Of course CGContextDrawImage uses vector
operations, etc. to process image data as needed and aspects of video
hardware (likely more and more in the future).
In fact a majority of the time is spent in CGContextDrawImage when
scrolling and viewing a set of images. So it looks like they are just
using standard Quartz2D calls to do this but likely are taking steps to
reuse image references as much as possible because Quartz2D can do
better caching, etc. then.
They obviously adjust down the scaling, etc. when scrolling to reduce
processing over head. The file data appear to be memory mapped.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden