1 /* -*- C++ -*-
2  *
3  *  This file is part of RawTherapee.
4  *
5  *  Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
6  *
7  *  RawTherapee is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation, either version 3 of the License, or
10  *  (at your option) any later version.
11  *
12  *  RawTherapee is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with RawTherapee.  If not, see <http://www.gnu.org/licenses/>.
19  */
20 #ifndef __IMAGEDATA_H__
21 #define __IMAGEDATA_H__
22 
23 #include <cstdio>
24 #include <memory>
25 #include "rawimage.h"
26 #include <string>
27 #include <glibmm.h>
28 #include "procparams.h"
29 #include "rtengine.h"
30 #include "metadata.h"
31 #include "gainmap.h"
32 
33 namespace rtengine
34 {
35 
36 class FramesData : public FramesMetaData {
37 private:
38     bool ok_;
39     Glib::ustring fname_;
40     unsigned int dcrawFrameCount;
41     struct tm time;
42     time_t timeStamp;
43     int iso_speed;
44     double aperture;
45     double focal_len, focal_len35mm;
46     float focus_dist;  // dist: 0=unknown, 10000=infinity
47     double shutter;
48     double expcomp;
49     std::string make, model, serial;
50     std::string orientation;
51     std::string lens;
52     IIOSampleFormat sampleFormat;
53     bool isPixelShift;
54     bool isHDR;
55     int rating_;
56     std::vector<GainMap> gain_maps_;
57     int w_;
58     int h_;
59     bool dng_;
60 
61 public:
62     FramesData (const Glib::ustring& fname);
63 
64     void setDCRawFrameCount(unsigned int frameCount);
65     unsigned int getFrameCount() const override;
66     bool getPixelShift() const override;
67     bool getHDR() const override;
68     std::string getImageType() const override;
69     IIOSampleFormat getSampleFormat() const override;
70     bool hasExif() const override;
71     tm getDateTime() const override;
72     time_t getDateTimeAsTS() const override;
73     int getISOSpeed() const override;
74     double getFNumber() const override;
75     double getFocalLen() const override;
76     double getFocalLen35mm() const override;
77     float getFocusDist() const override;
78     double getShutterSpeed() const override;
79     double getExpComp() const override;
80     std::string getMake() const override;
81     std::string getModel() const override;
82     std::string getLens() const override;
83     std::string getSerialNumber() const;
84     std::string getOrientation() const override;
85     Glib::ustring getFileName() const override;
86     int getRating() const override;
getGainMaps()87     std::vector<GainMap> getGainMaps() const override { return gain_maps_; }
88     void getDimensions(int &w, int &h) const override;
89 
90     void fillBasicTags(Exiv2::ExifData &exif) const;
91 
setGainMaps(const std::vector<GainMap> & m)92     void setGainMaps(const std::vector<GainMap> &m)
93     {
94         gain_maps_ = m;
95     }
96 
97     void setDimensions(int w, int h);
setDNG(bool yes)98     void setDNG(bool yes) { dng_ = yes; }
isDNG()99     bool isDNG() const override { return dng_; }
100 };
101 
102 
103 }
104 #endif
105