libopenraw  0.3.7
mrwfile.hpp
1 /*
2  * libopenraw - mrwfile.hpp
3  *
4  * Copyright (C) 2006-2020 Hubert Figuière
5  * Copyright (C) 2008 Bradley Broom
6  *
7  * This library is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation, either version 3 of
10  * the License, or (at your option) any later version.
11  *
12  * This library 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 GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  */
21 
22 #pragma once
23 
24 #include <stdint.h>
25 #include <vector>
26 
27 #include <libopenraw/consts.h>
28 
29 #include "rawfile.hpp"
30 #include "ifdfile.hpp"
31 #include "io/stream.hpp"
32 
33 namespace OpenRaw {
34 
35 class RawData;
36 class Thumbnail;
37 
38 namespace Internals {
39 
40 class MRWFile
41  : public IfdFile
42 {
43  template<typename T>
44  friend void audit_coefficients();
45 
46 public:
47  static RawFile *factory(const IO::Stream::Ptr&);
48  MRWFile(const IO::Stream::Ptr &);
49 
50  MRWFile(const MRWFile&) = delete;
51  MRWFile & operator=(const MRWFile&) = delete;
52 
53 protected:
54  virtual IfdDir::Ref _locateCfaIfd() override;
55  virtual IfdDir::Ref _locateMainIfd() override;
56 
57  virtual void _identifyId() override;
58 
59  virtual ::or_error _enumThumbnailSizes(std::vector<uint32_t> &list) override;
60  virtual ::or_error _getThumbnail(uint32_t size, Thumbnail & thumbnail) override;
61  virtual ::or_error _getRawData(RawData & data, uint32_t options) override;
62 private:
63 
64  static const struct IfdFile::camera_ids_t s_def[];
65 };
66 
67 }
68 }
69 
70 /*
71  Local Variables:
72  mode:c++
73  c-file-style:"stroustrup"
74  c-file-offsets:((innamespace . 0))
75  indent-tabs-mode:nil
76  fill-column:80
77  End:
78 */
std::shared_ptr< Stream > Ptr
Definition: stream.hpp:47
std::shared_ptr< IfdDir > Ref
Shared ptr of an IfdDir.
Definition: ifddir.hpp:56
or_error
Error codes returned by libopenraw.
Definition: consts.h:42
Global namespace for libopenraw.
Definition: arwfile.cpp:29
virtual ::or_error _enumThumbnailSizes(std::vector< uint32_t > &list) override
List the thumbnails in the IFD.
Definition: mrwfile.cpp:139
virtual void _identifyId() override
Identify the file and set the ID internally.
Definition: mrwfile.cpp:118
virtual ::or_error _getRawData(RawData &data, uint32_t options) override
Get the RAW data.
Definition: mrwfile.cpp:197
virtual IfdDir::Ref _locateCfaIfd() override
Locate the IFD for the raw data.
Definition: mrwfile.cpp:103
virtual IfdDir::Ref _locateMainIfd() override
Locate the main IFD.
Definition: mrwfile.cpp:109