Results 1 to 3 of 3
-
04-21-2010, 05:40 AM #1
- Member Since
- Apr 21, 2010
- Posts
- 2
Objective C - CIImage / CIFilter / mImageView
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
Manu
-
04-21-2010, 04:52 PM #2
- Member Since
- Jun 25, 2005
- Location
- On the road
- Posts
- 3,231
- Specs:
- 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
I know almost nothing regarding CIImage, but you are at minimum missing;
Code:[filter setValue: aSourceCIImage forKey:@"inputImage"];
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.
-
05-26-2010, 12:02 PM #3
- Member Since
- May 26, 2010
- Posts
- 1
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
[CIImage imageWithContentsOfUrl: NSURL * fileURL];
There are many other constructors for the CIImage class too.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Objective-C help
By bikka in forum macOS - Development and DarwinReplies: 22Last Post: 05-27-2014, 02:56 PM -
Need help in objective C
By prateek.chaubey in forum iOS DevelopmentReplies: 3Last Post: 09-23-2011, 09:12 PM -
Objective-C
By eddielee in forum macOS - Development and DarwinReplies: 2Last Post: 02-02-2011, 12:27 PM -
Is Objective For me?
By Estanislao in forum macOS - Apps and GamesReplies: 1Last Post: 05-26-2009, 04:13 AM -
Objective-C
By AstralZenith in forum macOS - Development and DarwinReplies: 13Last Post: 03-09-2003, 10:15 AM