Mailing Lists: Apple Mailing Lists

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

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!
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to 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.