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
34namespace OpenRaw {
35
36namespace Internals {
37
38enum {
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
50public:
51 typedef std::shared_ptr<RafMetaValue> Ref;
52 RafMetaValue(uint16_t tag, uint16_t size, const MetaValue &v);
54
55 const MetaValue &get() const { return m_value; }
56 uint16_t tag() const { return m_tag; }
57 uint16_t size() const { return m_size; }
58
59private:
60 uint16_t m_tag;
61 uint16_t m_size;
62 MetaValue m_value;
63};
64
66public:
67 RafMetaContainer(const IO::Stream::Ptr &_file);
68
69 uint32_t count();
70 RafMetaValue::Ref getValue(uint16_t tag);
71
72private:
73 void _read();
74 uint32_t m_count;
75 std::map<uint16_t, RafMetaValue::Ref> m_tags;
76};
77}
78}
79
80#endif
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard....
Definition: arwfile.cpp:30