libopenraw
arwfile.cpp
1 /*
2  * libopenraw - arwfile.cpp
3  *
4  * Copyright (C) 2006,2008 Hubert Figuiere
5  *
6  * This library is free software: you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation, either version 3 of
9  * the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 #include <libopenraw/libopenraw.h>
23 #include <libopenraw++/thumbnail.h>
24 
25 #include "trace.h"
26 #include "io/file.h"
27 #include "ifdfilecontainer.h"
28 #include "ifd.h"
29 #include "arwfile.h"
30 
31 using namespace Debug;
32 
33 namespace OpenRaw {
34 
35 
36  namespace Internals {
37 
38  const IFDFile::camera_ids_t ARWFile::s_def[] = {
39  { "DSLR-A100", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
40  OR_TYPEID_SONY_A100) },
41  { "DSLR-A200", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
42  OR_TYPEID_SONY_A200) },
43  { "DSLR-A550", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
44  OR_TYPEID_SONY_A550) },
45  { "DSLR-A700", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_SONY,
46  OR_TYPEID_SONY_A700) },
47  { 0, 0 }
48  };
49 
50 
51  RawFile *ARWFile::factory(IO::Stream * s)
52  {
53  return new ARWFile(s);
54  }
55 
56  ARWFile::ARWFile(IO::Stream *s)
57  : IFDFile(s, OR_RAWFILE_TYPE_ARW)
58  {
59  _setIdMap(s_def);
60  }
61 
62  ARWFile::~ARWFile()
63  {
64  }
65 
66  IFDDir::Ref ARWFile::_locateCfaIfd()
67  {
68  // in ARW the CFA IFD is the main IFD
69  if(!m_mainIfd) {
70  m_mainIfd = _locateMainIfd();
71  }
72  return m_mainIfd;
73  }
74 
75 
76  IFDDir::Ref ARWFile::_locateMainIfd()
77  {
78  return m_container->setDirectory(0);
79  }
80 
81  ::or_error ARWFile::_getRawData(RawData & /*data*/, uint32_t /*options*/)
82  {
83  return OR_ERROR_NOT_FOUND;
84  }
85 
86  }
87 }
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:33
Definition: trace.cpp:28
base virtual class for IO
Definition: stream.h:40