libopenraw
rafcontainer.hpp
1 /* -*- tab-width:4; c-basic-offset:4 -*- */
2 /*
3  * libopenraw - rafcontainer.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_RAFCONTAINER_H_
23 #define OR_INTERNALS_RAFCONTAINER_H_
24 
25 #include <stdint.h>
26 #include <string>
27 
28 #include "io/stream.hpp"
29 #include "rawcontainer.hpp"
30 
31 namespace OpenRaw {
32 
33 namespace Internals {
34 
35 class JfifContainer;
36 class IfdFileContainer;
37 class RafMetaContainer;
38 
40 {
41  // 36 bytes skipped
42  uint32_t jpegOffset;
43  uint32_t jpegLength;
44  uint32_t metaOffset;
45  uint32_t metaLength;
46  uint32_t cfaOffset;
47  uint32_t cfaLength;
48 };
49 
51  : public RawContainer
52 {
53 public:
54  RafContainer(const IO::Stream::Ptr &_file);
56  virtual ~RafContainer();
57 
58  const std::string & getModel();
59  JfifContainer * getJpegPreview();
60  IfdFileContainer * getCfaContainer();
61  RafMetaContainer * getMetaContainer();
62  uint32_t getJpegOffset() const
63  {
64  return m_offsetDirectory.jpegOffset;
65  }
66  uint32_t getJpegLength() const
67  {
68  return m_offsetDirectory.jpegLength;
69  }
70  uint32_t getCfaOffset() const
71  {
72  return m_offsetDirectory.cfaOffset;
73  }
74  uint32_t getCfaLength() const
75  {
76  return m_offsetDirectory.cfaLength;
77  }
78 private:
79  bool _readHeader();
80  bool m_read;
81  std::string m_model;
82  uint32_t m_version;
83  RafOffsetDirectory m_offsetDirectory;
84 
85  JfifContainer * m_jpegPreview;
86  IfdFileContainer * m_cfaContainer;
87  RafMetaContainer * m_metaContainer;
88 };
89 
90 }
91 }
92 
93 #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