Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't CIFilter +filterWithName:keysAndValues: invoke -setDefaults?



setDefaults has costs involved and those can vary from filter to filter (especially in terms of elaborate 3rd party image units that might do computation to determine defaults). So you don't want to tax every filter creation with it, therefore it is an opt-in model.
But your concern is still valuable feedback for us.


Frank

On Jun 15, 2005, at 4:00 PM, Roland Torres wrote:

Why doesn't CIFilter +filterWithName:keysAndValues: invoke - setDefaults?

To use +filterWithName:keysAndValues:, I have to be careful to include certain "required" keys before I chain the filters, or I get runtime errors like:

An uncaught exception was raised
CIUnsharpMask: sharpen: nil value for argument #2 (scale)
*** Uncaught exception: <CIKernelNilArgument> CIUnsharpMask: sharpen: nil value for argument #2 (scale)
Program has exited due to signal 5 (SIGTRAP).


In this case, the CIUnsharpMask filter requires "inputImage" and "inputIntensity" but not "inputRadius" (I can leave it out). Who is to know? There are many like this. How can I know which keys are required?

If CIFilter +filterWithName:keysAndValues: can invoke -setDefaults, then it is much easier to set up a chain of filters, since I only need to use this one method, and I don't need to supply values for all of the keys at this point.

Roland

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden
References: 
 >Why doesn't CIFilter +filterWithName:keysAndValues: invoke -setDefaults? (From: Roland Torres <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.