libopenraw  0.3.7
peffile.hpp
1 /* -*- Mode: C++ -*- */
2 /*
3  * libopenraw - peffile.h
4  *
5  * Copyright (C) 2006-2020 Hubert Figuière
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 
26 #include <libopenraw/consts.h>
27 
28 #include "rawfile.hpp"
29 #include "ifddir.hpp"
30 #include "io/stream.hpp"
31 #include "ifdfile.hpp"
32 
33 namespace OpenRaw {
34 
35 class RawData;
36 
37 namespace Internals {
38 
39 class PEFFile
40  : public IfdFile
41 {
42  template<typename T>
43  friend void audit_coefficients();
44 
45 public:
46  static RawFile *factory(const IO::Stream::Ptr &s);
47  PEFFile(const IO::Stream::Ptr &);
48  virtual ~PEFFile();
49 
50  PEFFile(const PEFFile&) = delete;
51  PEFFile & operator=(const PEFFile &) = delete;
52 
53 protected:
54  virtual ::or_error _enumThumbnailSizes(std::vector<uint32_t> &list) override;
55  virtual ::or_error _getRawData(RawData & data, uint32_t options) override;
56  virtual bool vendorCameraIdLocation(Internals::IfdDir::Ref& ifd, uint16_t& index,
57  const Internals::ModelIdMap*& model_map) override;
58 private:
59  static const IfdFile::camera_ids_t s_def[];
60 };
61 
62 }
63 }
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
std::map< uint32_t, ::or_rawfile_typeid > ModelIdMap
Definition: rawfile.hpp:54
Global namespace for libopenraw.
Definition: arwfile.cpp:29
virtual ::or_error _getRawData(RawData &data, uint32_t options) override
Get the RAW data.
Definition: peffile.cpp:297
virtual bool vendorCameraIdLocation(Internals::IfdDir::Ref &ifd, uint16_t &index, const Internals::ModelIdMap *&model_map) override
Get the vendor camera ID location.
Definition: peffile.cpp:283
virtual ::or_error _enumThumbnailSizes(std::vector< uint32_t > &list) override
List the thumbnails in the IFD.
Definition: peffile.cpp:255