Re: Here is code to Convert RGB <-> HSB
Re: Here is code to Convert RGB <-> HSB
- Subject: Re: Here is code to Convert RGB <-> HSB
- From: Nicko van Someren <email@hidden>
- Date: Mon, 11 Feb 2008 22:11:28 +0000
On 11 Feb 2008, at 20:22, Duncan Champney wrote:
My application needs to be able to make HSB adjustments to all the
pixels in RGB NSImages that are potentially quite large. (e.g. take
an RGB pixel, reduce the brightness by 20%, and increase the
saturation by 50%)
The NSColor class has excellent support for this, but you have to
create an instance of NSColor for every value you need. I'd need to
create several NSColor objects for every pixel on the screen, each
time my app updates it's image. This would involved allocating and
releasing millions of objects for each screen update.
You could also take a look at CoreImage and in particular the filter
called CIColorControls, which should let you do this pretty efficiently.
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