title: Determining Image Luminance/Brightness
body: <p>My iphone application captures the realtime data from camera using AVFoundation's AVCaptureSession. I'm able to access that data in it's delegate method in runtime and create an image out of it. It can be CGImage, UIImage or just raw data (CMSampleBufferRef). </p>
  
  <p>What I'm trying to do is to calculate luminance, brightness of that data (image). Or it can be some other value that can indicate me how bright the input light is.</p>
  
  <p>Is there any standard way to get this value? Perhaps using OpenGL. </p>
  
  <p>Thanks in advance.</p>