• 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
CALayer compositingFilter trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CALayer compositingFilter trouble


  • Subject: CALayer compositingFilter trouble
  • From: Markus Spoettl <email@hidden>
  • Date: Thu, 26 Apr 2012 18:12:37 +0200

Hello,

I'm posting this here because quartz-dev seems dead. I have a layer hosting view where I use a -compositingFilter with a CIColorBlendMode filter (default settings). It's constructed and applied to the layer like this:

    CIFilter *cf = [CIFilter filterWithName:@"CIColorBlendMode"];
    [cf setDefaults];
    [overlayLayer setCompositingFilter:cf];

overlayLayer is z-ordered above another layer that has a grayscale content (a height field). I draw colors into the overlayLayer which in turn colorizes the height field. Works fine but some colors give me grieve in that the hue is completely wrong and I have no idea why.

To illustrate the problem I've uploaded an annotated screenshot here:

http://www.shiftoption.com/temp/blendingtrouble.png

It shows both the colors used (upper rect) and blended result (lower rect). The upper screen shot is for two colors that "work". The lower is for a color that doesn't (color C). The difference between the two is saturation, 0.1 works, 0.003 doesn't (in case you wonder, 0.004 works).

So, these work:
[NSColor colorWithCalibratedHue:0.55 saturation:0.1 brightness:1.0 alpha:1.0]
[NSColor colorWithCalibratedHue:1.0 saturation:0.8 brightness:0.8 alpha:1.0]

This one doesn't:
[NSColor colorWithCalibratedHue:0.55 saturation:0.003 brightness:1.0 alpha:1.0]

I don't have the slightest idea why the hue changes so dramatically. Maybe this is to be expected? Why? Can I avoid that? How?

Any tips greatly appreciated!

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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

  • Follow-Ups:
    • Re: CALayer compositingFilter trouble
      • From: David Duncan <email@hidden>
  • Prev by Date: RE: removeFromSuperview problem
  • Next by Date: Re: CALayer compositingFilter trouble
  • Previous by thread: Re: DataSource modified while TableView is displaying data
  • Next by thread: Re: CALayer compositingFilter trouble
  • Index(es):
    • Date
    • Thread