Custom Image Unit/CIFilter troubles
Custom Image Unit/CIFilter troubles
- Subject: Custom Image Unit/CIFilter troubles
- From: Petteri Kamppuri <email@hidden>
- Date: Fri, 8 Jul 2005 04:20:24 +0300
I'm having a little trouble with custom CIFilters packaged as Image
Units. I've used the standard filters without problems and I can
chain them nicely. However, when I try to use filters I've created
myself, I can't get them to work.
I've created a new Image Unit using the Xcode Image Unit Plugin
project template. I built the project and copied the plugin to ~/
Library/Graphics/Image Units. Then I load the plugin in my app using
[CIPlugIn loadAllPlugIns];. I've inserted the custom Image Unit
filter to my filter chain. The chain works fine and produces the
wanted result image without this new filter.
This is how the code which creates and uses the custom Image Unit
looks like:
filter = [CIFilter filterWithName:@"MyKernelFilter"]; // Note
that the name of the filter and the Image Unit Plugin don't match.
[filter setValue:result forKey:@"inputImage"]; // result
is a CIImage
[filter setValue:[NSNumber numberWithFloat:4]
forKey:@"inputScale"];
[filter setValue:[NSNumber numberWithFloat:1.4]
forKey:@"inputGreenWeight"];
NSLog(@"filter %@", filter);
result = [filter valueForKey:@"outputImage"];
NSLog(@"result %@", result);
The first NSLog outputs the following (verifying I have a valid
filter object):
filter {CIPlugInStandardFilter {
inputGreenWeight = 1.4;
inputImage = {CIImage [0 0 800 600]};
inputScale = 4;
}}
The second NSLog outputs this:
result {CIImage [-1.70141e+38 -1.70141e+38 3.40282e+38 3.40282e+38]}
So something goes wrong inside the custom Image Unit filter. But
what? I have another custom Image Unit and the results are the same.
Is there something more I need to do to make these custom Image Units
to work? I've tried to read the documetation, but I haven't seen
anything that would help.
Thanks for any help,
Petteri
_______________________________________________
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