libopenraw
rafmetacontainer.hpp
1 /* -*- Mode: C++ -*- */
2 /*
3  * libopenraw - rafmetacontainer.h
4  *
5  * Copyright (C) 2011-2016 Hubert Figuiere
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 #ifndef OR_INTERNALS_RAFMETACONTAINER_H_
23 #define OR_INTERNALS_RAFMETACONTAINER_H_
24 
25 #include <stdint.h>
26 
27 #include <memory>
28 #include <map>
29 
30 #include "metavalue.hpp"
31 #include "io/stream.hpp"
32 #include "rawcontainer.hpp"
33 
34 namespace OpenRaw {
35 
36 namespace Internals {
37 
38 enum {
39  RAF_TAG_INVALID = 0,
40  RAF_TAG_SENSOR_DIMENSION = 0x100, // the RAW dimensions
41  RAF_TAG_IMG_TOP_LEFT = 0x110,
42  RAF_TAG_IMG_HEIGHT_WIDTH = 0x111,
43  RAF_TAG_OUTPUT_HEIGHT_WIDTH =
44  0x121, // this is the one dcraw use for the active area
45  RAF_TAG_RAW_INFO = 0x130, // some info about the RAW.
46  _RAF_TAG_LAST
47 };
48 
49 class RafMetaValue {
50 public:
51  typedef std::shared_ptr<RafMetaValue> Ref;
52  RafMetaValue(uint16_t tag, uint16_t size, const MetaValue &v);
53  ~RafMetaValue();
54 
55  const MetaValue &get() const { return m_value; }
56 
57 private:
58  uint16_t m_tag;
59  uint16_t m_size;
60  MetaValue m_value;
61 };
62 
64 public:
65  RafMetaContainer(const IO::Stream::Ptr &_file);
66 
67  uint32_t count();
68  RafMetaValue::Ref getValue(uint16_t tag);
69 
70 private:
71  void _read();
72  uint32_t m_count;
73  std::map<uint16_t, RafMetaValue::Ref> m_tags;
74 };
75 }
76 }
77 
78 #endif
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
Definition: arwfile.cpp:30