Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalculateMeanExposure.cpp
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
26 #include "CalculateMeanExposure.h"
27 
28 #include <panodata/PanoramaData.h>
29 
30 
31 namespace HuginBase {
32 
33 
36 {
37  double exposure=0;
38  size_t counter = 0;
39  for (size_t i = 0; i < pano.getNrOfImages(); i++)
40  {
41  const HuginBase::SrcPanoImage& img = pano.getImage(i);
42  if (img.getActive())
43  {
44  exposure += img.getExposureValue();
45  ++counter;
46  };
47  }
48  return (counter > 0) ? (exposure / counter) : 0.0;
49 }
50 
51 
52 }
static double calcMeanExposure(const PanoramaData &pano)
Model for a panorama.
Definition: PanoramaData.h:81
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
virtual std::size_t getNrOfImages() const =0
number of images.
All variables of a source image.
Definition: SrcPanoImage.h:194