Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Exiv2Helper.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
11 /*
12  * This is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This software is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public
23  * License along with this software. If not, see
24  * <http://www.gnu.org/licenses/>.
25  *
26  */
27 
28 #ifndef _EXIV2HELPER_H
29 #define _EXIV2HELPER_H
30 
31 #include <string>
32 #include <vector>
33 #include <exiv2/exif.hpp>
34 
35 // these functions are intentionally not exposed to public
36 // they are supposed only be used by SrcPanoImage.cpp for internal use
37 
38 namespace HuginBase
39 {
40  namespace Exiv2Helper
41  {
42  // helper function to return a single value
43  const double getExiv2ValueDouble(Exiv2::ExifData& exifData, Exiv2::ExifData::const_iterator it);
44  const double getExiv2ValueDouble(Exiv2::ExifData& exifData, std::string keyName);
45  const std::string getExiv2ValueString(Exiv2::ExifData& exifData, Exiv2::ExifData::const_iterator it);
46  const std::string getExiv2ValueString(Exiv2::ExifData& exifData, std::string keyName);
47  const long getExiv2ValueLong(Exiv2::ExifData& exifData, Exiv2::ExifData::const_iterator it);
48  const long getExiv2ValueLong(Exiv2::ExifData& exifData, std::string keyName);
49  bool getExiv2GPSLatitude(Exiv2::ExifData& exifData, double& latitude);
50  bool getExiv2GPSLongitude(Exiv2::ExifData& exifData, double& longitude);
51 
52  // read the RedBalance and BlueBalance data from makernotes of different manufactures
53  bool readRedBlueBalance(Exiv2::ExifData &exifData, double & redBalance, double & blueBalance);
54  // read the crop factor from the EXIF data, code for handling with different variants for saving crop factor
55  const double getCropFactor(Exiv2::ExifData &exifData, long width, long height);
56  // read the lens name for EXIF or makernotes data
57  const std::string getLensName(Exiv2::ExifData &exifData);
58  };
59 };
60 #endif
const std::string getLensName(Exiv2::ExifData &exifData)
const double getExiv2ValueDouble(Exiv2::ExifData &exifData, Exiv2::ExifData::const_iterator it)
const long getExiv2ValueLong(Exiv2::ExifData &exifData, Exiv2::ExifData::const_iterator it)
const std::string getExiv2ValueString(Exiv2::ExifData &exifData, Exiv2::ExifData::const_iterator it)
bool getExiv2GPSLongitude(Exiv2::ExifData &exifData, double &longitude)
const double getCropFactor(Exiv2::ExifData &exifData, long width, long height)
bool getExiv2GPSLatitude(Exiv2::ExifData &exifData, double &latitude)
bool readRedBlueBalance(Exiv2::ExifData &exifData, double &redBalance, double &blueBalance)