• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Here is code to Convert RGB <-> HSB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Here is code to Convert RGB <-> HSB (From: Duncan Champney <email@hidden>)

  • Prev by Date: Re: @property problem
  • Next by Date: Challenging text editing field problem
  • Previous by thread: Here is code to Convert RGB <-> HSB
  • Next by thread: @property problem
  • Index(es):
    • Date
    • Thread