CIColorMap filter usage
CIColorMap filter usage
- Subject: CIColorMap filter usage
- From: Jason Horn <email@hidden>
- Date: Wed, 28 Nov 2007 12:37:12 -0500
Does anyone have any experience with using the core image CIColorMap
filter? I have tried looking at the example in the FunHouse example,
but I still can't get it to work, even using the same example image
and color map from the FunHouse project. I end up with a greyscale
image. Here's my code...
// color map
NSURL *url = [NSURL fileURLWithPath: [[NSBundle mainBundle]
pathForResource: @"colormap" ofType: @"tiff"]];
colorMap = [CIImage imageWithContentsOfURL: url];
// test image
NSURL *url = [NSURL fileURLWithPath: [[NSBundle mainBundle]
pathForResource: @"Copenhagen" ofType: @"jpg"]];
CIImage *testImage = [CIImage imageWithContentsOfURL: url];
// filter
colorMapFilter = [CIFilter filterWithName:@"CIColorMap"];
[colorMapFilter setValue:testImage forKey:@"inputImage"];
[colorMapFilter setValue:colorMap forKey:@"inputGradientImage"];
resultImg = [colorMapFilter valueForKey: @"outputImage"];
// draw the result
[context drawImage:resultImg atPoint:cg.origin fromRect:cg];
Thanks!
_______________________________________________
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