libopenraw  0.3.7
dngfile.hpp
1 /* -*- Mode: C++ -*- */
2 /*
3  * libopenraw - dngfile.hpp
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 "ifdfile.hpp"
30 #include "io/stream.hpp"
31 #include "tiffepfile.hpp"
32 
33 namespace OpenRaw {
34 
35 class RawData;
36 
37 namespace Internals {
38 
48 class DngFile
49  : public TiffEpFile
50 {
51  template<typename T>
52  friend void audit_coefficients();
53 public:
54  static RawFile *factory(const IO::Stream::Ptr &);
55 
56  DngFile(const IO::Stream::Ptr &);
57  virtual ~DngFile();
58 
59  DngFile(const DngFile&) = delete;
60  DngFile & operator=(const DngFile&) = delete;
61 
62 
64  virtual or_colour_matrix_origin getColourMatrixOrigin() const override;
65 
70  bool isCinema() const;
71 protected:
73  virtual ::or_error _enumThumbnailSizes(std::vector<uint32_t>& list) override;
75  virtual ::or_error _getRawData(RawData & data, uint32_t options) override;
77  virtual void _identifyId() override;
78 
79 private:
80 
81  static const IfdFile::camera_ids_t s_def[];
82 };
83 
84 }
85 }
std::shared_ptr< Stream > Ptr
Definition: stream.hpp:47
TIFF.EP conformant files.
Definition: tiffepfile.hpp:44
Represent camera raw data.
Definition: rawdata.hpp:38
RAW file.
Definition: rawfile.hpp:66
virtual or_colour_matrix_origin getColourMatrixOrigin() const override
Get the origin of the colour matrix for the RAW file.
Definition: dngfile.cpp:260
bool isCinema() const
Tell if a file is Cinema DNG.
virtual ::or_error _enumThumbnailSizes(std::vector< uint32_t > &list) override
Enumerate the thumbnail sizes.
Definition: dngfile.cpp:265
virtual void _identifyId() override
Identify the file and set the ID internally.
Definition: dngfile.cpp:359
virtual ::or_error _getRawData(RawData &data, uint32_t options) override
Get the RAW data.
Definition: dngfile.cpp:283
or_colour_matrix_origin
Where the colour matrix comes from. Typically DNG is provided. The others are built-in.
Definition: consts.h:121
or_error
Error codes returned by libopenraw.
Definition: consts.h:42
Global namespace for libopenraw.
Definition: arwfile.cpp:29