Results 1 to 3 of 3
  1. #1

    Member Since
    Apr 21, 2010
    Angry 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


  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    On the road
    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;
    [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.

  3. #3
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Objective-C help
    By bikka in forum OS X - Development and Darwin
    Replies: 22
    Last Post: 05-27-2014, 02:56 PM
  2. Need help in objective C
    By prateek.chaubey in forum iOS Development
    Replies: 3
    Last Post: 09-23-2011, 09:12 PM
  3. Objective-C
    By eddielee in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 02-02-2011, 12:27 PM
  4. Is Objective For me?
    By Estanislao in forum OS X - Apps and Games
    Replies: 1
    Last Post: 05-26-2009, 04:13 AM
  5. Objective-C
    By AstralZenith in forum OS X - Development and Darwin
    Replies: 13
    Last Post: 03-09-2003, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts