CIColorMap filter usage

  • 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!
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today