libopenraw  0.3.7
ifd.hpp
1 /*
2  * libopenraw - ifd.hpp
3  *
4  * Copyright (C) 2006-2007, 2012-2023 Hubert Figuière
5  *
6  * Defintions taken from libexif:
7  * Copyright (C) 2001 Lutz Müller <lutz@users.sourceforge.net>
8  *
9  * This library is free software: you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation, either version 3 of
12  * the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library. If not, see
21  * <http://www.gnu.org/licenses/>.
22  */
23 
24 #pragma once
25 
26 #include <stdint.h>
27 #include <math.h>
28 
29 namespace OpenRaw {
30 namespace Internals {
31 
37 namespace IFD {
38 
39 #define INCLUDE_EXIF_
40 #include "libopenraw/exif.h"
41 #undef INCLUDE_EXIF_
42 
44 typedef enum {
45  CFA_RED = 0,
46  CFA_GREEN = 1,
47  CFA_BLUE = 2,
48  CFA_CYAN = 3,
49  CFA_MAGENTA = 4,
50  CFA_YELLOW = 5,
51  CFA_WHITE = 6
52 } CfaComponent;
53 
55 typedef enum {
59  COMPRESS_ARW = 32767,
63  COMPRESS_CUSTOM = 65535,
64  COMPRESS_OLYMPUS = 65536
66 
68 inline
69 double to_double(const ORRational& r)
70 {
71  if (r.denom == 0) {
72  return INFINITY;
73  }
74  return (double)r.num / (double)r.denom;
75 }
76 
78 inline
79 double to_double(const ORSRational& r)
80 {
81  if (r.denom == 0) {
82  return INFINITY;
83  }
84  return (double)r.num / (double)r.denom;
85 }
86 
87 }
88 
91 }
92 }
93 /*
94  Local Variables:
95  mode:c++
96  c-file-style:"stroustrup"
97  c-file-offsets:((innamespace . 0))
98  indent-tabs-mode:nil
99  fill-column:80
100  End:
101 */
TiffCompress
TIFF compression.
Definition: ifd.hpp:55
CfaComponent
Component colour from CFA. Duplicate of or_cfa_pattern_colour.
Definition: ifd.hpp:44
double to_double(const ORRational &r)
Convert an ORRational to a double.
Definition: ifd.hpp:69
Global namespace for libopenraw.
Definition: arwfile.cpp:29