summaryrefslogtreecommitdiff
path: root/gpr/source/lib/dng_sdk/dng_shared.h
blob: b67d7a65ab763ec2dfe5b87eb2829adb780e69c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
/*****************************************************************************/
// Copyright 2006-2008 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE:  Adobe permits you to use, modify, and distribute this file in
// accordance with the terms of the Adobe license agreement accompanying it.
/*****************************************************************************/

/* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_shared.h#1 $ */ 
/* $DateTime: 2012/05/30 13:28:51 $ */
/* $Change: 832332 $ */
/* $Author: tknoll $ */

/*****************************************************************************/

#ifndef __dng_shared__
#define __dng_shared__

/*****************************************************************************/

#include "dng_classes.h"
#include "dng_fingerprint.h"
#include "dng_matrix.h"
#include "dng_negative.h"
#include "dng_rational.h"
#include "dng_string.h"
#include "dng_stream.h"
#include "dng_sdk_limits.h"
#include "dng_types.h"
#include "dng_xy_coord.h"

#include <vector>

/*****************************************************************************/

class dng_camera_profile_info
	{
	
	public:
	
		bool fBigEndian;
	
		uint32 fColorPlanes;
		
		uint32 fCalibrationIlluminant1;
		uint32 fCalibrationIlluminant2;
		
		dng_matrix fColorMatrix1;
		dng_matrix fColorMatrix2;
		
		dng_matrix fForwardMatrix1;
		dng_matrix fForwardMatrix2;
		
		dng_matrix fReductionMatrix1;
		dng_matrix fReductionMatrix2;

		dng_string fProfileCalibrationSignature;

		dng_string fProfileName;

		dng_string fProfileCopyright;

		uint32 fEmbedPolicy;
		
		uint32 fProfileHues;
		uint32 fProfileSats;
		uint32 fProfileVals;

		uint64 fHueSatDeltas1Offset;
		uint32 fHueSatDeltas1Count;

		uint64 fHueSatDeltas2Offset;
		uint32 fHueSatDeltas2Count;
		
		uint32 fHueSatMapEncoding;
		
		uint32 fLookTableHues;
		uint32 fLookTableSats;
		uint32 fLookTableVals;
		
		uint64 fLookTableOffset;
		uint32 fLookTableCount;

		uint32 fLookTableEncoding;

		dng_srational fBaselineExposureOffset;

		uint32 fDefaultBlackRender;
		
		uint64 fToneCurveOffset;
		uint32 fToneCurveCount;
		
		dng_string fUniqueCameraModel;
		
	public:
	
		dng_camera_profile_info ();
		
		~dng_camera_profile_info ();
		
		bool ParseTag (dng_stream &stream,
					   uint32 parentCode,
					   uint32 tagCode,
					   uint32 tagType,
					   uint32 tagCount,
					   uint64 tagOffset);
					   
		bool ParseExtended (dng_stream &stream);

	};
		
/*****************************************************************************/

class dng_shared
	{
	
	public:
	
		uint64 fExifIFD;
		uint64 fGPSInfo;
		uint64 fInteroperabilityIFD;
		uint64 fKodakDCRPrivateIFD;
		uint64 fKodakKDCPrivateIFD;
		
		uint32 fXMPCount;
		uint64 fXMPOffset;
		
		uint32 fIPTC_NAA_Count;
		uint64 fIPTC_NAA_Offset;

		uint32 fMakerNoteCount;
		uint64 fMakerNoteOffset;
		uint32 fMakerNoteSafety;
		
		uint32 fDNGVersion;
		uint32 fDNGBackwardVersion;
		
		dng_string fUniqueCameraModel;
		dng_string fLocalizedCameraModel;
		
		dng_camera_profile_info fCameraProfile;
		
		std::vector<dng_camera_profile_info> fExtraCameraProfiles;

		dng_matrix fCameraCalibration1;
		dng_matrix fCameraCalibration2;
		
		dng_string fCameraCalibrationSignature;

		dng_vector fAnalogBalance;
		
		dng_vector fAsShotNeutral;
		
		dng_xy_coord fAsShotWhiteXY;
		
		dng_srational fBaselineExposure;
		dng_urational fBaselineNoise;
		dng_urational fNoiseReductionApplied;
		dng_urational fBaselineSharpness;
		dng_urational fLinearResponseLimit;
		dng_urational fShadowScale;
		
		bool fHasBaselineExposure;
		bool fHasShadowScale;
		
		uint32 fDNGPrivateDataCount;
		uint64 fDNGPrivateDataOffset;

		dng_fingerprint fRawImageDigest;
		dng_fingerprint fNewRawImageDigest;
		
		dng_fingerprint fRawDataUniqueID;
		
		dng_string fOriginalRawFileName;
		
		uint32 fOriginalRawFileDataCount;
		uint64 fOriginalRawFileDataOffset;
		
		dng_fingerprint fOriginalRawFileDigest;
		
		uint32 fAsShotICCProfileCount;
		uint64 fAsShotICCProfileOffset;
		
		dng_matrix fAsShotPreProfileMatrix;
		
		uint32 fCurrentICCProfileCount;
		uint64 fCurrentICCProfileOffset;
		
		dng_matrix fCurrentPreProfileMatrix;
		
		uint32 fColorimetricReference;

		dng_string fAsShotProfileName;

		dng_noise_profile fNoiseProfile;

		dng_point fOriginalDefaultFinalSize;
		dng_point fOriginalBestQualityFinalSize;
		
		dng_urational fOriginalDefaultCropSizeH;
		dng_urational fOriginalDefaultCropSizeV;
		
	public:
	
		dng_shared ();
		
		virtual ~dng_shared ();
		
		virtual bool ParseTag (dng_stream &stream,
							   dng_exif &exif,
							   uint32 parentCode,
							   bool isMainIFD,
							   uint32 tagCode,
							   uint32 tagType,
							   uint32 tagCount,
							   uint64 tagOffset,
							   int64 offsetDelta);
							   
		virtual void PostParse (dng_host &host,
								dng_exif &exif);
		
		virtual bool IsValidDNG ();
		
	protected:
		
		virtual bool Parse_ifd0 (dng_stream &stream,
							     dng_exif &exif,
							 	 uint32 parentCode,
							 	 uint32 tagCode,
							 	 uint32 tagType,
							 	 uint32 tagCount,
							 	 uint64 tagOffset);
							 		 
		virtual bool Parse_ifd0_exif (dng_stream &stream,
							          dng_exif &exif,
						 		 	  uint32 parentCode,
						 		 	  uint32 tagCode,
						 		 	  uint32 tagType,
						 		 	  uint32 tagCount,
						 		 	  uint64 tagOffset);
	
	};
	
/*****************************************************************************/

#endif
	
/*****************************************************************************/