libopenraw  0.3.7
orffile.hpp
1 /* -*- Mode: C++; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3  * libopenraw - orffile.hpp
4  *
5  * Copyright (C) 2006-2022 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 #include <string>
26 #include <vector>
27 
28 #include <libopenraw/consts.h>
29 
30 #include "rawfile.hpp"
31 #include "ifd.hpp"
32 #include "ifddir.hpp"
33 #include "ifdfile.hpp"
34 #include "io/stream.hpp"
35 
36 namespace OpenRaw {
37 
38 class RawData;
39 
40 namespace Internals {
41 
42 class OrfFile : public IfdFile {
43  template<typename T>
44  friend void audit_coefficients();
45 
46 public:
47  static RawFile *factory(const IO::Stream::Ptr &);
48  OrfFile(const IO::Stream::Ptr &);
49  virtual ~OrfFile();
50 
51  OrfFile(const OrfFile &) = delete;
52  OrfFile &operator=(const OrfFile &) = delete;
53 
54 protected:
55  ::or_error _enumThumbnailSizes(std::vector<uint32_t> &list) override;
56  virtual ::or_error _getRawData(RawData &data, uint32_t options) override;
57 
58 private:
59  ::or_error decompress(uint32_t x, uint32_t y, RawData& data);
60  ::or_error addThumbnail(std::vector<uint32_t>& list, uint32_t offset, uint32_t len);
61  static RawFile::TypeId _typeIdFromModel(const std::string &model);
62 
63  static const IfdFile::camera_ids_t s_def[];
64 };
65 }
66 }
std::shared_ptr< Stream > Ptr
Definition: stream.hpp:47
or_error
Error codes returned by libopenraw.
Definition: consts.h:42
Global namespace for libopenraw.
Definition: arwfile.cpp:29
::or_error _enumThumbnailSizes(std::vector< uint32_t > &list) override
List the thumbnails in the IFD.
Definition: orffile.cpp:398
virtual ::or_error _getRawData(RawData &data, uint32_t options) override
Get the RAW data.
Definition: orffile.cpp:445