Is there any way to check the light intensity using iPhone? Does API allows to do this?
I suppose you can easily do this yourself:
UIImage
. UIImage
to a CGImageRef
( UIImage.CGImage
). x += (red + green + blue) / 3.f;
avg = x / numberOfPixels;
. avg
will now give you a float indicating the average brightness of the still. Most of the time (if not always), this will be identical to the light intensity.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.