| 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 |
/** \file |
| 10 |
* Collection of constants detailing maximum values used in processing in the DNG SDK. |
| 11 |
*/ |
| 12 |
|
| 13 |
/*****************************************************************************/ |
| 14 |
|
| 15 |
#ifndef __dng_sdk_limits__ |
| 16 |
#define __dng_sdk_limits__ |
| 17 |
|
| 18 |
/*****************************************************************************/ |
| 19 |
|
| 20 |
#include "dng_flags.h" |
| 21 |
#include "dng_types.h" |
| 22 |
|
| 23 |
/*****************************************************************************/ |
| 24 |
|
| 25 |
/// The maximum number of previews (in addition to the main IFD's thumbnail) |
| 26 |
/// that we support embedded in a DNG. |
| 27 |
|
| 28 |
const uint32 kMaxDNGPreviews = 20; |
| 29 |
|
| 30 |
/// Maximum supported number of semantic masks. |
| 31 |
|
| 32 |
const uint32 kMaxSemanticMasks = 100; |
| 33 |
|
| 34 |
/// The maximum number of SubIFDs that will be parsed. |
| 35 |
|
| 36 |
const uint32 kMaxSubIFDs = kMaxDNGPreviews + kMaxSemanticMasks + 5; |
| 37 |
|
| 38 |
/// The maximum number of chained IFDs that will be parsed. |
| 39 |
|
| 40 |
const uint32 kMaxChainedIFDs = 10; |
| 41 |
|
| 42 |
/// The maximum number of samples per pixel. (CMYK + transparency needs 5) |
| 43 |
|
| 44 |
const uint32 kMaxSamplesPerPixel = 5; |
| 45 |
|
| 46 |
/// Maximum number of color planes. |
| 47 |
|
| 48 |
const uint32 kMaxColorPlanes = 4; |
| 49 |
|
| 50 |
/// The maximum size of a CFA repeating pattern. |
| 51 |
|
| 52 |
const uint32 kMaxCFAPattern = 8; |
| 53 |
|
| 54 |
/// The maximum size of a black level repeating pattern. |
| 55 |
|
| 56 |
const uint32 kMaxBlackPattern = 8; |
| 57 |
|
| 58 |
/// The maximum number of masked area rectangles. |
| 59 |
|
| 60 |
const uint32 kMaxMaskedAreas = 4; |
| 61 |
|
| 62 |
/// The maximum image size supported (pixels per side). |
| 63 |
|
| 64 |
#if qDNGBigImage |
| 65 |
const uint32 kMaxImageSide = 300000; |
| 66 |
#else |
| 67 |
const uint32 kMaxImageSide = 65000; |
| 68 |
#endif |
| 69 |
|
| 70 |
/// The maximum number of tone curve points supported. |
| 71 |
|
| 72 |
const uint32 kMaxToneCurvePoints = 8192; |
| 73 |
|
| 74 |
/// Maximum number of MP threads for dng_area_task operations. |
| 75 |
|
| 76 |
#if qDNG64Bit |
| 77 |
const uint32 kMaxMPThreads = 128; // EP! Needs much larger max! |
| 78 |
#else |
| 79 |
const uint32 kMaxMPThreads = 8; |
| 80 |
#endif |
| 81 |
|
| 82 |
/// Maximum supported value of Stage3BlackLevelNormalized. |
| 83 |
|
| 84 |
const real64 kMaxStage3BlackLevelNormalized = 0.2; |
| 85 |
|
| 86 |
/// Maximum supported number of points in a ProfileGainTableMap. Currently set |
| 87 |
/// to 64 megabytes. |
| 88 |
|
| 89 |
const uint32 kMaxProfileGainTableMapPoints = 16777216; |
| 90 |
|
| 91 |
/// Minimum and maximum gain values in a ProfileGainTableMap. The |
| 92 |
/// specification only requires that values be positive, but this SDK |
| 93 |
/// implementation assumes that values outside the following range are errors. |
| 94 |
|
| 95 |
const real32 kProfileGainTableMap_MinGainValue = 0.000244140625f; // 1 / 4096 |
| 96 |
const real32 kProfileGainTableMap_MaxGainValue = 4096.0f; |
| 97 |
|
| 98 |
/// Minimum and maximum gamma parameter value in a ProfileGainTableMap2. |
| 99 |
|
| 100 |
const real32 kProfileGainTableMap_MinGamma = 0.125f; |
| 101 |
const real32 kProfileGainTableMap_MaxGamma = 8.000f; |
| 102 |
|
| 103 |
const uint32 kMinSpectrumSamples = 2; |
| 104 |
|
| 105 |
/// The maximum number of spectral power samples for an illuminant. |
| 106 |
/// A sampling that covers 360 to 730 nm in 1 nm steps is just 371 samples, |
| 107 |
/// so 1000 seems more than enough. |
| 108 |
|
| 109 |
const uint32 kMaxSpectrumSamples = 1000; |
| 110 |
|
| 111 |
/*****************************************************************************/ |
| 112 |
|
| 113 |
/// Maximum recursion depth when parsing IFDs in dng_info. |
| 114 |
|
| 115 |
const uint32 kMaxParseDepth = 10; |
| 116 |
|
| 117 |
/*****************************************************************************/ |
| 118 |
|
| 119 |
#endif // __dng_sdk_limits__ |
| 120 |
|
| 121 |
/*****************************************************************************/ |