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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
/*****************************************************************************/
// Copyright 2006-2012 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_ifd.h#3 $ */
/* $DateTime: 2012/06/05 11:05:39 $ */
/* $Change: 833352 $ */
/* $Author: tknoll $ */
/** \file
* DNG image file directory support.
*/
/*****************************************************************************/
#ifndef __dng_ifd__
#define __dng_ifd__
/*****************************************************************************/
#include "dng_fingerprint.h"
#include "dng_rect.h"
#include "dng_shared.h"
#include "dng_stream.h"
#include "dng_string.h"
#include "dng_sdk_limits.h"
#include "dng_tag_values.h"
/*****************************************************************************/
class dng_preview_info
{
public:
bool fIsPrimary;
dng_string fApplicationName;
dng_string fApplicationVersion;
dng_string fSettingsName;
dng_fingerprint fSettingsDigest;
PreviewColorSpaceEnum fColorSpace;
dng_string fDateTime;
real64 fRawToPreviewGain;
uint32 fCacheVersion;
public:
dng_preview_info ();
~dng_preview_info ();
};
/*****************************************************************************/
/// \brief Container for a single image file directory of a digital negative.
///
/// See \ref spec_dng "DNG 1.1.0 specification" for documentation of specific tags.
class dng_ifd
{
public:
bool fUsesNewSubFileType;
uint32 fNewSubFileType;
uint32 fImageWidth;
uint32 fImageLength;
uint32 fBitsPerSample [kMaxSamplesPerPixel];
uint32 fCompression;
uint32 fPredictor;
uint32 fPhotometricInterpretation;
uint32 fFillOrder;
uint32 fOrientation;
uint32 fOrientationType;
uint64 fOrientationOffset;
bool fOrientationBigEndian;
uint32 fSamplesPerPixel;
uint32 fPlanarConfiguration;
real64 fXResolution;
real64 fYResolution;
uint32 fResolutionUnit;
bool fUsesStrips;
bool fUsesTiles;
uint32 fTileWidth;
uint32 fTileLength;
enum
{
kMaxTileInfo = 32
};
uint32 fTileOffsetsType;
uint32 fTileOffsetsCount;
uint64 fTileOffsetsOffset;
uint64 fTileOffset [kMaxTileInfo];
uint32 fTileByteCountsType;
uint32 fTileByteCountsCount;
uint64 fTileByteCountsOffset;
uint32 fTileByteCount [kMaxTileInfo];
uint32 fSubIFDsCount;
uint64 fSubIFDsOffset;
uint32 fExtraSamplesCount;
uint32 fExtraSamples [kMaxSamplesPerPixel];
uint32 fSampleFormat [kMaxSamplesPerPixel];
uint32 fJPEGTablesCount;
uint64 fJPEGTablesOffset;
uint64 fJPEGInterchangeFormat;
uint32 fJPEGInterchangeFormatLength;
real64 fYCbCrCoefficientR;
real64 fYCbCrCoefficientG;
real64 fYCbCrCoefficientB;
uint32 fYCbCrSubSampleH;
uint32 fYCbCrSubSampleV;
uint32 fYCbCrPositioning;
real64 fReferenceBlackWhite [6];
uint32 fCFARepeatPatternRows;
uint32 fCFARepeatPatternCols;
uint8 fCFAPattern [kMaxCFAPattern] [kMaxCFAPattern];
uint8 fCFAPlaneColor [kMaxColorPlanes];
uint32 fCFALayout;
uint32 fLinearizationTableType;
uint32 fLinearizationTableCount;
uint64 fLinearizationTableOffset;
uint32 fBlackLevelRepeatRows;
uint32 fBlackLevelRepeatCols;
real64 fBlackLevel [kMaxBlackPattern] [kMaxBlackPattern] [kMaxSamplesPerPixel];
uint32 fBlackLevelDeltaHType;
uint32 fBlackLevelDeltaHCount;
uint64 fBlackLevelDeltaHOffset;
uint32 fBlackLevelDeltaVType;
uint32 fBlackLevelDeltaVCount;
uint64 fBlackLevelDeltaVOffset;
real64 fWhiteLevel [kMaxSamplesPerPixel];
dng_urational fDefaultScaleH;
dng_urational fDefaultScaleV;
dng_urational fBestQualityScale;
dng_urational fDefaultCropOriginH;
dng_urational fDefaultCropOriginV;
dng_urational fDefaultCropSizeH;
dng_urational fDefaultCropSizeV;
dng_urational fDefaultUserCropT;
dng_urational fDefaultUserCropL;
dng_urational fDefaultUserCropB;
dng_urational fDefaultUserCropR;
uint32 fBayerGreenSplit;
dng_urational fChromaBlurRadius;
dng_urational fAntiAliasStrength;
dng_rect fActiveArea;
uint32 fMaskedAreaCount;
dng_rect fMaskedArea [kMaxMaskedAreas];
uint32 fRowInterleaveFactor;
uint32 fSubTileBlockRows;
uint32 fSubTileBlockCols;
dng_preview_info fPreviewInfo;
uint32 fOpcodeList1Count;
uint64 fOpcodeList1Offset;
uint32 fOpcodeList2Count;
uint64 fOpcodeList2Offset;
uint32 fOpcodeList3Count;
uint64 fOpcodeList3Offset;
bool fLosslessJPEGBug16;
uint32 fSampleBitShift;
uint64 fThisIFD;
uint64 fNextIFD;
int32 fCompressionQuality;
bool fPatchFirstJPEGByte;
public:
dng_ifd ();
virtual ~dng_ifd ();
virtual bool ParseTag (dng_stream &stream,
uint32 parentCode,
uint32 tagCode,
uint32 tagType,
uint32 tagCount,
uint64 tagOffset);
virtual void PostParse ();
virtual bool IsValidDNG (dng_shared &shared,
uint32 parentCode);
dng_rect Bounds () const
{
return dng_rect (0,
0,
fImageLength,
fImageWidth);
}
uint32 TilesAcross () const;
uint32 TilesDown () const;
uint32 TilesPerImage () const;
dng_rect TileArea (uint32 rowIndex,
uint32 colIndex) const;
virtual uint32 TileByteCount (const dng_rect &tile) const;
void SetSingleStrip ();
void FindTileSize (uint32 bytesPerTile = 128 * 1024,
uint32 cellH = 16,
uint32 cellV = 16);
void FindStripSize (uint32 bytesPerStrip = 128 * 1024,
uint32 cellV = 16);
virtual uint32 PixelType () const;
virtual bool IsBaselineJPEG () const;
virtual bool CanRead () const;
virtual void ReadImage (dng_host &host,
dng_stream &stream,
dng_image &image,
dng_jpeg_image *jpegImage = NULL,
dng_fingerprint *jpegDigest = NULL) const;
protected:
virtual bool IsValidCFA (dng_shared &shared,
uint32 parentCode);
};
/*****************************************************************************/
#endif
/*****************************************************************************/
|