0

I have a function is that

(NSArray *) getRGBsFromImage:(UIImage *)image atX:(int)xx andY:(int)yy count:(int) count {
   NSMutableArray *result;
   NSUInteger width=...;
   NSUInteger height=...;
   //algorithm
   return result;
}

I'm implementing a function that

(NSArray *) convertRGBAsForBW: (NSArray *) grayscaleArray
{
// as input i have to access grayscale array..but this array gives me rgbvalues in an NSArray and also I have to implement image.size, height, width...

}

How can I implement it, calling function in function? and how can I access Image's size,height,width ??

1
  • You can mix objective-c and c syntax in your code, so what's the problem? Commented Jan 27, 2011 at 21:07

2 Answers 2

2

If they are in the same class you can do something like this.

-(NSArray *) getRGBsFromImage:(UIImage *)image atX:(int)xx andY:(int)yy count:(int) count 
{
    //...
}   


- (NSArray *) convertRGBAsForBW: (NSArray *) grayscaleArray
{
    NSMutableArray *someArray = [NSMutableArray array];

    for (UIImage *image in grayscaleArray)
    {
        [someArray addObject:[self getRGBsFromImage:image atX:image.frame.origin.x andY:image.frame.origin.y count:[grayscaleArray count]]];
    }

    return someArray;
}
Sign up to request clarification or add additional context in comments.

Comments

1

I'm assuming your 2 methods are inside the same class. If they are you can simply call
[self methodName]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.