Re: Core Image generate histogram?
Re: Core Image generate histogram?
- Subject: Re: Core Image generate histogram?
- From: Nicko van Someren <email@hidden>
- Date: Wed, 9 Jan 2008 19:33:10 +0000
On 8 Jan 2008, at 11:01, Albert Martin wrote:
I am using some heavy Core Image filters along with Core Video in my
Leopard application. I was wondering if someone could point me in
the right direction to generating a simple levels histogram from a
CIImage. I am hoping for something that is along the lines of the
histogram used in iPhoto or iMovie's adjustment palette. I'm not
sure if I can go right from CIImage or if I'll need to go to NSImage
or even OpenGL. I've spent a while searching the lists and the
documentation and haven't found any straight forward methods so if
someone could just give me a shove in the right direction I'd
appreciate it.
CoreImage images are usually only rendered on demand so I think that
you will need for it to be rendered, perhaps to a CGBitmapContext.
From there you should be able to use the histogram calculation
function in the vImage library (vImageHistogramCalculation_ARGB8888)
to compute the histogram for the pixel data. The vImage library is
highly optimised and knows how to choose the best code irrespective of
the type of CPU the user has, using the vector processing parts of the
CPU if available.
Cheers,
Nicko
_______________________________________________
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