Re: Is QuickLook implemented upon CGImage or CGImageSource under the hood?
Re: Is QuickLook implemented upon CGImage or CGImageSource under the hood?
- Subject: Re: Is QuickLook implemented upon CGImage or CGImageSource under the hood?
- From: Mike Abdullah <email@hidden>
- Date: Fri, 07 Sep 2012 14:42:29 +0100
On 7 Sep 2012, at 13:26, Oleg Krupnov <email@hidden> wrote:
> Hi Mike,
>
> Interesting, thanks. I wasn't aware that CGImageSource was the fastest
> on the Mac. QuickLook sometimes seems so amazingly fast, even with
> giant images, so that it made me think it uses some more advanced or
> more low-level technology than CGImageSource which seems pretty old,
> isn't it. My question was basically about this.
Really, it seems "old"? Because it's one OS release elder?
It is up to the individual Quick Look plug-ins how exactly they go about thumbnailing. I assume for image files, Apple's importer uses CGImageSource under the hood.
But once again I should stress that it has the ability to cache usage across the whole OS; CGImageSource is limited to whatever caching you instruct it to do.
>
> A corollary: if QuickLook is built on CGImageSource, then QuickLook
> should support the same set of image formats as CGImageSource. Is this
> the case? (Not counting third-party QL plugins)
Well the whole point of Quick Look is that it support *everything*. Yes for plenty of files you'll just get back the icon. But it has broader support than CGImageSource alone does.
It is possible that there are formats supported by CGImageSource that no-one got round to declaring Quick Look support for. But I don't know of any offhand.
>
> I want to load an image as fast as possible and display it. But maybe
> I gonna need to manipulate it a bit. What's the story change?
If you're going to manipulate an image, you almost certainly want, well, the real image. CGImageSourceCreateImageAtIndex() gives you this. The thumbnail APIs do *not*. They give you a scaled down approximation instead. For the illusion of speed, it may well be in your interest to load a thumbnail first and display that, while loading the real image in the background.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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