With 1.7 million freelancers, we'll match you with the perfect talent.
The client has made the following changes to the job.
Client prefers freelancers from:
You are still able to submit a proposal for this job.
The client prefers freelancers from
a different location.
I need an iOS Objective-C algorithm that will quantify the "darkness" level of a passed-in UIImage. I need the function for the following signature implemented:
+ (CGFloat)darkLevelForImage:(UIImage *)image;
The function will return a float value between 0.0 and 1.0 specifying the darkness level of the passed-in image. The higher the darkness level, the higher the returned value. In the attached sample, dark1.jpg would return 1.0, and dark2.jpg and dark3.jpg would return successively smaller values. -1 is returned if the passed-in image is nil.
- You can use any public iOS framework available in iOS 6.0 or below (non-deprecated).
- I'd prefer not to use any external third-party libraries.
- The function should return in less than 1 second on a 4th generation iPod touch.
Let me know if you have any questions.
Sign in or Register to see more