libopenraw  0.3.7
rawfile_private.hpp
1 /*
2  * libopenraw - rawfile_private.h
3  *
4  * Copyright (C) 2012-2018 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 #ifndef OR_INTERNALS_RAWFILE_PRIV_H_
22 #define OR_INTERNALS_RAWFILE_PRIV_H_
23 
24 #include <assert.h>
25 
26 #include <map>
27 
28 #include "rawfile.hpp"
29 #include "bitmapdata.hpp"
30 
31 namespace OpenRaw {
32 namespace Internals {
33 
36 {
37  OpenRaw::RawFile::TypeId camera;
38  uint16_t black;
39  uint16_t white;
40  int16_t matrix[9]; // in 1/10,000th
41 };
42 
46 class ThumbDesc
47 {
48 public:
49  ThumbDesc(uint32_t _x, uint32_t _y, ::or_data_type t,
50  std::unique_ptr<BitmapData>&& d)
51  : x(_x), y(_y), type(t)
52  , offset(0), length(0)
53  , data(std::move(d))
54  {
55  }
56  ThumbDesc(uint32_t _x, uint32_t _y, ::or_data_type _type,
57  size_t _offset, size_t _length)
58  : x(_x), y(_y), type(_type)
59  , offset(_offset), length(_length)
60  , data(nullptr)
61  {
62 #ifdef DEBUG
63  assert(_length);
64 #endif
65  }
66  ThumbDesc()
67  : x(0), y(0), type(OR_DATA_TYPE_NONE)
68  , offset(0), length(0), data(nullptr)
69  {
70  }
71  uint32_t x;
72  uint32_t y;
74  size_t offset;
75  size_t length;
76  std::unique_ptr<BitmapData> data;
77 };
78 
79 typedef std::map<uint32_t, ThumbDesc> ThumbLocations;
80 
81 }
82 }
83 
84 /*
85  Local Variables:
86  mode:c++
87  c-file-style:"stroustrup"
88  c-file-offsets:((innamespace . 0))
89  tab-width:2
90  c-basic-offset:2
91  indent-tabs-mode:nil
92  fill-column:80
93  End:
94 */
95 #endif
std::unique_ptr< BitmapData > data
or_data_type
Data types.
Definition: consts.h:80
Global namespace for libopenraw.
Definition: arwfile.cpp:29