Re: Bindings, and Core Image
Re: Bindings, and Core Image
- Subject: Re: Bindings, and Core Image
- From: Ron Aldrich <email@hidden>
- Date: Fri, 13 Apr 2007 17:01:20 -0700
On Apr 13, 2007, at 3:48 PM, Ron Aldrich wrote:
Folks,
I'm having a bit of a problem, using bindings with a core image
filter that I'm working on.
The filter is actually constructed as a composite of several other
filters, which it uses bindings to keep in sync.
The problem I'm having is that changes to one of it's parameters
(in this case, inputOrigin) are not reflected by calls to outputImage.
inputOrigin is bound to a user interface element, which allows the
effect to be positioned on the image.
What I would expect to have happen is that when inputOrigin is
changed, it would trigger a change notification for outputKeyColor,
which would then trigger a change notification for outputImage.
What actually happens is that the change notification for
outputKeyColor occurs, but the notification for outputImage does not.
Hmm - I've found a workaround, as follows: (KVOASSIGNOBJECT is a
macro that does the retain/release calls properly, and calls will/
didChangeValueForKey for @"inputOrigin").
- (void) setInputOrigin: (CIVector*) inValue
{
KVOASSIGNOBJECT(inputOrigin, inValue);
[self willChangeValueForKey: @"outputImage"];
[self didChangeValueForKey: @"outputImage"];
}
What I don't understand is why this is necessary - I would have
thought that
+ (void) initialize
{
[self setKeys: [NSArray arrayWithObjects:
@"inputImage",
@"inputOrigin",
// ...
nil]
triggerChangeNotificationsForDependentKey: @"outputKeycolor"];
[self setKeys: [NSArray arrayWithObjects:
@"inputImage",
// ...
@"outputKeycolor",
nil]
triggerChangeNotificationsForDependentKey: @"outputImage"];
// ...
}
would have resulted in the same behavior.
Ron Aldrich
Software Architects, Inc.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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