1 /*****************************************************************************/
2 // Copyright 2006-2019 Adobe Systems Incorporated
3 // All Rights Reserved.
4 //
5 // NOTICE:  Adobe permits you to use, modify, and distribute this file in
6 // accordance with the terms of the Adobe license agreement accompanying it.
7 /*****************************************************************************/
8 
9 #ifndef __dng_tag_values__
10 #define __dng_tag_values__
11 
12 /*****************************************************************************/
13 
14 #include "dng_flags.h"
15 
16 /*****************************************************************************/
17 
18 // Values for NewSubFileType tag.
19 
20 enum
21 	{
22 
23 	// The main image data.
24 
25 	sfMainImage					= 0,
26 
27 	// Preview image for the primary settings.
28 
29 	sfPreviewImage				= 1,
30 
31 	// Transparency mask
32 
33 	sfTransparencyMask			= 4,
34 
35 	// Preview (reduced resolution raw) transparency mask.
36 
37 	sfPreviewMask				= sfPreviewImage + sfTransparencyMask,
38 
39     // Depth map.
40 
41     sfDepthMap                  = 8,
42 
43     // Preview (reduced resolution raw) depth map.
44 
45     sfPreviewDepthMap           = sfPreviewImage + sfDepthMap,
46 
47     // Enhanced image (processed stage 3).
48 
49     sfEnhancedImage             = 16,
50 
51 	// Preview image for non-primary settings.
52 
53 	sfAltPreviewImage			= 0x10001
54 
55 	};
56 
57 /******************************************************************************/
58 
59 // Values for PhotometricInterpretation tag.
60 
61 enum
62 	{
63 
64 	piWhiteIsZero 				= 0,
65 	piBlackIsZero				= 1,
66 	piRGB						= 2,
67 	piRGBPalette				= 3,
68 	piTransparencyMask			= 4,
69 	piCMYK						= 5,
70 	piYCbCr						= 6,
71 	piCIELab					= 8,
72 	piICCLab					= 9,
73 
74 	piCFA						= 32803,		// TIFF-EP spec
75 
76 	piLinearRaw					= 34892,
77 
78     piDepth                     = 51177
79 
80 	};
81 
82 /******************************************************************************/
83 
84 // Values for PlanarConfiguration tag.
85 
86 enum
87 	{
88 
89 	pcInterleaved				= 1,
90 	pcPlanar					= 2,
91 
92 	// Ordering, using an RGB image as an example:
93 	//
94 	// RRRRRRRRRR
95 	// GGGGGGGGGG
96 	// BBBBBBBBBB
97 	// RRRRRRRRRR
98 	// GGGGGGGGGG
99 	// BBBBBBBBBB
100 	//
101 	// The "AlignSIMD" variant additionally ensures that the offset of each
102 	// plane's row is aligned to an integer multiple of SIMD vector width (16
103 	// or 32) bytes from the beginning of the buffer.
104 	pcRowInterleaved			= 100000,		// Internal use only
105 	pcRowInterleavedAlignSIMD	= 100001		// Internal use only
106 
107 	};
108 
109 /******************************************************************************/
110 
111 // Values for ExtraSamples tag.
112 
113 enum
114 	{
115 
116 	esUnspecified				= 0,
117 	esAssociatedAlpha			= 1,
118 	esUnassociatedAlpha			= 2
119 
120 	};
121 
122 /******************************************************************************/
123 
124 // Values for SampleFormat tag.
125 
126 enum
127 	{
128 
129 	sfUnsignedInteger			= 1,
130 	sfSignedInteger				= 2,
131 	sfFloatingPoint				= 3,
132 	sfUndefined					= 4
133 
134 	};
135 
136 /******************************************************************************/
137 
138 // Values for Compression tag.
139 
140 enum
141 	{
142 
143 	ccUncompressed				= 1,
144 	ccLZW						= 5,
145 	ccOldJPEG					= 6,
146 	ccJPEG						= 7,
147 	ccDeflate					= 8,
148 
149 	#if qDNGSupportVC5
150 	ccVc5						= 9,
151 	#endif	// qDNGSupportVC5
152 
153 	ccPackBits					= 32773,
154 	ccOldDeflate				= 32946,
155 
156 	// Used in DNG files in places that allow lossless JPEG.
157 
158 	ccLossyJPEG					= 34892
159 
160 	};
161 
162 /******************************************************************************/
163 
164 // Values for Predictor tag.
165 
166 enum
167 	{
168 
169 	cpNullPredictor				= 1,
170 	cpHorizontalDifference		= 2,
171 	cpFloatingPoint				= 3,
172 
173 	cpHorizontalDifferenceX2	= 34892,
174 	cpHorizontalDifferenceX4	= 34893,
175 	cpFloatingPointX2			= 34894,
176 	cpFloatingPointX4			= 34895
177 
178 	};
179 
180 /******************************************************************************/
181 
182 // Values for ResolutionUnit tag.
183 
184 enum
185 	{
186 
187 	ruNone						= 1,
188 	ruInch						= 2,
189 	ruCM						= 3,
190 	ruMM						= 4,
191 	ruMicroM					= 5
192 
193 	};
194 
195 /******************************************************************************/
196 
197 // Values for LightSource tag.
198 
199 enum
200 	{
201 
202 	lsUnknown					=  0,
203 
204 	lsDaylight					=  1,
205 	lsFluorescent				=  2,
206 	lsTungsten					=  3,
207 	lsFlash						=  4,
208 	lsFineWeather				=  9,
209 	lsCloudyWeather				= 10,
210 	lsShade						= 11,
211 	lsDaylightFluorescent		= 12,		// D  5700 - 7100K
212 	lsDayWhiteFluorescent		= 13,		// N  4600 - 5500K
213 	lsCoolWhiteFluorescent		= 14,		// W  3800 - 4500K
214 	lsWhiteFluorescent			= 15,		// WW 3250 - 3800K
215 	lsWarmWhiteFluorescent		= 16,		// L  2600 - 3250K
216 	lsStandardLightA			= 17,
217 	lsStandardLightB			= 18,
218 	lsStandardLightC			= 19,
219 	lsD55						= 20,
220 	lsD65						= 21,
221 	lsD75						= 22,
222 	lsD50						= 23,
223 	lsISOStudioTungsten			= 24,
224 
225 	lsOther						= 255
226 
227 	};
228 
229 /******************************************************************************/
230 
231 // Values for ExposureProgram tag.
232 
233 enum
234 	{
235 
236 	epUnidentified				= 0,
237 	epManual					= 1,
238 	epProgramNormal				= 2,
239 	epAperturePriority			= 3,
240 	epShutterPriority			= 4,
241 	epProgramCreative			= 5,
242 	epProgramAction				= 6,
243 	epPortraitMode				= 7,
244 	epLandscapeMode				= 8
245 
246 	};
247 
248 /******************************************************************************/
249 
250 // Values for MeteringMode tag.
251 
252 enum
253 	{
254 
255 	mmUnidentified				= 0,
256 	mmAverage					= 1,
257 	mmCenterWeightedAverage		= 2,
258 	mmSpot						= 3,
259 	mmMultiSpot					= 4,
260 	mmPattern					= 5,
261 	mmPartial					= 6,
262 
263 	mmOther						= 255
264 
265 	};
266 
267 /******************************************************************************/
268 
269 // CFA color codes from the TIFF/EP specification.
270 
271 enum ColorKeyCode
272 	{
273 
274 	colorKeyRed					= 0,
275 	colorKeyGreen				= 1,
276 	colorKeyBlue				= 2,
277 	colorKeyCyan				= 3,
278 	colorKeyMagenta				= 4,
279 	colorKeyYellow				= 5,
280 	colorKeyWhite				= 6,
281 
282 	colorKeyMaxEnum				= 0xFF
283 
284 	};
285 
286 /*****************************************************************************/
287 
288 // Values for the SensitivityType tag.
289 
290 enum
291 	{
292 
293 	stUnknown					= 0,
294 
295 	stStandardOutputSensitivity = 1,
296 	stRecommendedExposureIndex	= 2,
297 	stISOSpeed					= 3,
298 	stSOSandREI					= 4,
299 	stSOSandISOSpeed			= 5,
300 	stREIandISOSpeed			= 6,
301 	stSOSandREIandISOSpeed		= 7
302 
303 	};
304 
305 /*****************************************************************************/
306 
307 // Values for the ColorimetricReference tag.  It specifies the colorimetric
308 // reference used for images with PhotometricInterpretation values of CFA
309 // or LinearRaw.
310 
311 enum
312 	{
313 
314 	// Scene referred (default):
315 
316 	crSceneReferred				= 0,
317 
318 	// Output referred using the parameters of the ICC profile PCS.
319 
320 	crICCProfilePCS				= 1
321 
322 	};
323 
324 /*****************************************************************************/
325 
326 // Values for the ProfileEmbedPolicy tag.
327 
328 enum
329 	{
330 
331 	// Freely embedable and copyable into installations that encounter this
332 	// profile, so long as the profile is only used to process DNG files.
333 
334 	pepAllowCopying				= 0,
335 
336 	// Can be embeded in a DNG for portable processing, but cannot be used
337 	// to process other files that the profile is not embedded in.
338 
339 	pepEmbedIfUsed				= 1,
340 
341 	// Can only be used if installed on the machine processing the file.
342 	// Note that this only applies to stand-alone profiles.  Profiles that
343 	// are already embedded inside a DNG file allowed to remain embedded
344 	// in that DNG, even if the DNG is resaved.
345 
346 	pepEmbedNever				= 2,
347 
348 	// No restricts on profile use or embedding.
349 
350 	pepNoRestrictions			= 3
351 
352 	};
353 
354 /*****************************************************************************/
355 
356 // Values for the ProfileHueSatMapEncoding and ProfileLookTableEncoding tags.
357 
358 enum
359 	{
360 
361 	// 1. Convert linear ProPhoto RGB values to HSV.
362 	// 2. Use the HSV coordinates to index into the color table.
363 	// 3. Apply color table result to the original HSV values.
364 	// 4. Convert modified HSV values back to linear ProPhoto RGB.
365 
366 	encoding_Linear				= 0,
367 
368 	// 1. Convert linear ProPhoto RGB values to HSV.
369 	// 2. Encode V coordinate using sRGB encoding curve.
370 	// 3. Use the encoded HSV coordinates to index into the color table.
371 	// 4. Apply color table result to the encoded values from step 2.
372 	// 5. Decode V coordinate using sRGB decoding curve (inverse of step 2).
373 	// 6. Convert HSV values back to linear ProPhoto RGB (inverse of step 1).
374 
375 	encoding_sRGB				= 1
376 
377 	};
378 
379 /*****************************************************************************/
380 
381 // Values for the DefaultBlackRender tag.
382 
383 enum
384 	{
385 
386 	// By default, the renderer applies (possibly auto-calculated) black subtraction
387 	// prior to the look table.
388 
389 	defaultBlackRender_Auto		= 0,
390 
391 	// By default, the renderer does not apply any black subtraction prior to the
392 	// look table.
393 
394 	defaultBlackRender_None		= 1
395 
396 	};
397 
398 /*****************************************************************************/
399 
400 // Values for the PreviewColorSpace tag.
401 
402 enum PreviewColorSpaceEnum
403 	{
404 
405 	previewColorSpace_Unknown		= 0,
406 	previewColorSpace_GrayGamma22	= 1,
407 	previewColorSpace_sRGB			= 2,
408 	previewColorSpace_AdobeRGB      = 3,
409 	previewColorSpace_ProPhotoRGB	= 4,
410 
411 	previewColorSpace_LastValid		= previewColorSpace_ProPhotoRGB,
412 
413 	previewColorSpace_MaxEnum		= 0xFFFFFFFF
414 
415 	};
416 
417 /*****************************************************************************/
418 
419 // Values for CacheVersion tag.
420 
421 enum
422 	{
423 
424 	// The low-16 bits are a rendering version number.
425 
426 	cacheVersionMask				= 0x0FFFF,
427 
428 	// Default cache version.
429 
430 	cacheVersionDefault				= 0x00100,
431 
432 	// Is this an integer preview of a floating point image?
433 
434 	cacheVersionDefloated			= 0x10000,
435 
436 	// Is this an flattening preview of an image with tranparency?
437 
438 	cacheVersionFlattened			= 0x20000,
439 
440 	// Was this preview build using a the default baseline multi-channel
441 	// CFA merge (i.e. only using the first channel)?
442 
443 	cacheVersionFakeMerge			= 0x40000
444 
445 	};
446 
447 /*****************************************************************************/
448 
449 // Values for the DepthFormat tag.
450 
451 enum
452     {
453     depthFormatUnknown              = 0,
454     depthFormatLinear               = 1,
455     depthFormatInverse              = 2
456     };
457 
458 // Values for the DepthUnits tag.
459 
460 enum
461     {
462     depthUnitsUnknown               = 0,
463     depthUnitsMeters                = 1
464     };
465 
466 // Values for DepthMeasureType tag.
467 
468 enum
469     {
470     depthMeasureUnknown             = 0,
471     depthMeasureOpticalAxis         = 1,
472     depthMeasureOpticalRay          = 2
473     };
474 
475 /*****************************************************************************/
476 
477 // TIFF-style byte order markers.
478 
479 enum
480 	{
481 
482 	byteOrderII					= 0x4949,		// 'II'
483 	byteOrderMM					= 0x4D4D		// 'MM'
484 
485 	};
486 
487 /*****************************************************************************/
488 
489 // "Magic" numbers.
490 
491 enum
492 	{
493 
494 	// DNG related.
495 
496 	magicTIFF					= 42,			// TIFF (and DNG)
497 	magicExtendedProfile		= 0x4352,		// 'CR'
498 	magicRawCache				= 1022,			// Raw cache (fast load data)
499 
500 	// Other raw formats - included here so the DNG SDK can parse them.
501 
502 	magicPanasonic				= 85,
503 	magicOlympusA				= 0x4F52,
504 	magicOlympusB				= 0x5352
505 
506 	};
507 
508 /*****************************************************************************/
509 
510 // DNG Version numbers
511 
512 enum
513 	{
514 
515 	dngVersion_None				= 0,
516 
517 	dngVersion_1_0_0_0			= 0x01000000,
518 	dngVersion_1_1_0_0			= 0x01010000,
519 	dngVersion_1_2_0_0			= 0x01020000,
520 	dngVersion_1_3_0_0			= 0x01030000,
521 	dngVersion_1_4_0_0			= 0x01040000,
522     dngVersion_1_5_0_0          = 0x01050000,
523 
524 	dngVersion_Current			= dngVersion_1_5_0_0,
525 
526 	dngVersion_SaveDefault		= dngVersion_1_4_0_0
527 
528 	};
529 
530 /*****************************************************************************/
531 
532 #endif
533 
534 /*****************************************************************************/
535