• 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: Binding to CoreImage?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding to CoreImage?


  • Subject: Re: Binding to CoreImage?
  • From: Troy Stephens <email@hidden>
  • Date: Fri, 21 Oct 2005 13:27:06 -0700

On Oct 20, 2005, at 11:58 PM, Colin Cornaby wrote:
Has anyone tried binding to a CIFilter? Anyone have any success? Doesn't look like binding to the attributes will work too well because that won't actually render it. I just have some controls on the screen that I want to progmatically bind.

Has anyone ever played with this? Google search found nothing.

See

    http://developer.apple.com/samplecode/Reducer/Reducer.html

for one example. Some of Reducer's UI elements have their values bound directly to CIFilter properties -- for example, the sharpen "Intensity" slider is bound to a CIUnsharpMaskFilter's "inputIntensity" attribute.

To receive notification that the output image needs to be re-rendered when one of these attributes is changed, the ImageReducer object uses KVO to add itself as an observer of the same attributes:

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (object == unsharpMaskFilter || object == shadow) {
[self updateOutputImage];
}
}


- init {

...
[unsharpMaskFilter addObserver:self forKeyPath:@"inputIntensity" options:0 context:NULL];
[unsharpMaskFilter addObserver:self forKeyPath:@"inputRadius" options:0 context:NULL];
...


Hope this helps!

--
Troy Stephens
Cocoa Frameworks
Apple Computer, Inc.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Binding to CoreImage?
      • From: Colin Cornaby <email@hidden>
References: 
 >Binding to CoreImage? (From: Colin Cornaby <email@hidden>)

  • Prev by Date: Re: Core Data: Dual-Inverse Relation Possible in Modeler?
  • Next by Date: Re: Saving the rows order of a table view
  • Previous by thread: Binding to CoreImage?
  • Next by thread: Re: Binding to CoreImage?
  • Index(es):
    • Date
    • Thread