New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Objective C - CIImage / CIFilter / mImageView

Post Reply New Thread Subscribe

Thread Tools

Member Since: Apr 21, 2010
Posts: 2
manuel_zoffoli is on a distinguished road

manuel_zoffoli is offline
Hi, I'm a new user and I'm moving the firsts steps into Objective C. I want to apply some filters (CIFilters) to an image (CIImage) that is contained into a mImageView (IKImageView). How can I do that?

My crazy mind thought to this:

NSArray *filters = nil;
CIFilter *filter = [CIFilter filterWithName:@"CIBloom"];
[filter setDefaults];
[filter setValue: [NSNumber numberWithFloat:2.0] forKey:@"inputRadius"];
filters = [NSArray arrayWithObject:filter];

CIImage *image; // in this line I don't know what to write...I put it, to intend that I declared a CIImage object
image = [filters valueForKey: @"outputImage"];

But unfortunately it doesn't work....can you help me?

Best Regards

QUOTE Thanks

xstep's Avatar
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
I know almost nothing regarding CIImage, but you are at minimum missing;
[filter setValue: aSourceCIImage forKey:@"inputImage"];
aSourceCIImage being the input image you are trying to manipulate. Other image types have to first be converted to a CIImage type for use in the filter.

I'm not sure what your intent is for the array, but that array will only hold one object since it is not a NSMutableArray.

If you are thinking of chaining multiple filters, I don't think you need an array. As I understand it, you use the output of the previous filter as the input to the next filter. The system will take care of optimizing all of the built up filters.

At the end of the code, you need a way to turn a CIImage into something displayable.

I would look at the Apple documentation and review the samples they link to.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks

Member Since: May 26, 2010
Posts: 1
JamesBedford is on a distinguished road

JamesBedford is offline
Did you manage to get any further with this?

For the line:

CIImage *image; // in this line I don't know what to write...I put it, to intend that I declared a CIImage object
You can create a new CIImage using:

[CIImage imageWithContentsOfUrl: NSURL * fileURL];

There are many other constructors for the CIImage class too.
QUOTE Thanks

Post Reply New Thread Subscribe

« Single user erase command | Wine - dotnet30 »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
why classes and objects are similar in objective c harsha973 OS X - Development and Darwin 2 05-11-2010 07:12 PM
dynamic mwmory allocation in objective c drewangel OS X - Development and Darwin 1 03-17-2010 01:45 AM
Has to be an easier way to deal with Time in Objective C fajhetti OS X - Development and Darwin 2 02-03-2010 11:43 AM
Objective C Books that don't need C knowledge J-Mak OS X - Development and Darwin 4 10-27-2009 12:31 AM
question about objective C memory allocation thuffir OS X - Development and Darwin 3 11-18-2008 10:30 PM

All times are GMT -4. The time now is 05:02 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?