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!