DocumentationOverviewBuilding ASL Documentation Library Wiki Docs Indices Browse Perforce More InfoRelease NotesWiki Site Search License Success Stories Contributors MediaDownloadPerforce Depots SupportASL SourceForge HomeMailing Lists Discussion Forums Report Bugs Suggest Features Contribute to ASL RSSShort-text newsFull-text news File releases Other Adobe ProjectsAdobe AirAdobe GIL Adobe Labs Adobe Media Gallery Adobe XMP Tamarin project (Mozilla Foundation) Other ResourcesBoostRIAForge SGI STL |
dng_parse_utils.h00001 /*****************************************************************************/ 00002 // Copyright 2006-2007 Adobe Systems Incorporated 00003 // All Rights Reserved. 00004 // 00005 // NOTICE: Adobe permits you to use, modify, and distribute this file in 00006 // accordance with the terms of the Adobe license agreement accompanying it. 00007 /*****************************************************************************/ 00008 00009 /* $Id: //mondo/workarea/stern/camera_raw/dng_sdk/source/dng_parse_utils.h#6 $ */ 00010 /* $DateTime: 2007/12/24 13:18:53 $ */ 00011 /* $Change: 408196 $ */ 00012 /* $Author: stern $ */ 00013 00014 /*****************************************************************************/ 00015 00016 #ifndef __dng_parse_utils__ 00017 #define __dng_parse_utils__ 00018 00019 /*****************************************************************************/ 00020 00021 #include "dng_classes.h" 00022 #include "dng_flags.h" 00023 #include "dng_types.h" 00024 #include "dng_stream.h" 00025 #include "dng_string.h" 00026 #include "dng_matrix.h" 00027 00028 /*****************************************************************************/ 00029 00030 #if qDNGValidate 00031 00032 /*****************************************************************************/ 00033 00034 const char * LookupParentCode (uint32 parentCode); 00035 00036 /*****************************************************************************/ 00037 00038 const char * LookupTagCode (uint32 parentCode, 00039 uint32 tagCode); 00040 00041 /*****************************************************************************/ 00042 00043 const char * LookupTagType (uint32 tagType); 00044 00045 /*****************************************************************************/ 00046 00047 const char * LookupNewSubFileType (uint32 key); 00048 00049 const char * LookupCompression (uint32 key); 00050 00051 const char * LookupPhotometricInterpretation (uint32 key); 00052 00053 const char * LookupOrientation (uint32 key); 00054 00055 const char * LookupResolutionUnit (uint32 key); 00056 00057 const char * LookupCFAColor (uint32 key); 00058 00059 const char * LookupSensingMethod (uint32 key); 00060 00061 const char * LookupExposureProgram (uint32 key); 00062 00063 const char * LookupMeteringMode (uint32 key); 00064 00065 const char * LookupLightSource (uint32 key); 00066 00067 const char * LookupColorSpace (uint32 key); 00068 00069 const char * LookupFileSource (uint32 key); 00070 00071 const char * LookupSceneType (uint32 key); 00072 00073 const char * LookupCustomRendered (uint32 key); 00074 00075 const char * LookupExposureMode (uint32 key); 00076 00077 const char * LookupWhiteBalance (uint32 key); 00078 00079 const char * LookupSceneCaptureType (uint32 key); 00080 00081 const char * LookupGainControl (uint32 key); 00082 00083 const char * LookupContrast (uint32 key); 00084 00085 const char * LookupSaturation (uint32 key); 00086 00087 const char * LookupSharpness (uint32 key); 00088 00089 const char * LookupSubjectDistanceRange (uint32 key); 00090 00091 const char * LookupComponent (uint32 key); 00092 00093 const char * LookupCFALayout (uint32 key); 00094 00095 const char * LookupMakerNoteSafety (uint32 key); 00096 00097 const char * LookupColorimetricReference (uint32 key); 00098 00099 const char * LookupPreviewColorSpace (uint32 key); 00100 00101 const char * LookupJPEGMarker (uint32 key); 00102 00103 /*****************************************************************************/ 00104 00105 void DumpHexAscii (dng_stream &stream, 00106 uint32 count); 00107 00108 void DumpHexAscii (const uint8 *buf, 00109 uint32 count); 00110 00111 void DumpXMP (dng_stream &stream, 00112 uint32 count); 00113 00114 void DumpString (const dng_string &s); 00115 00116 void DumpTagValues (dng_stream &stream, 00117 const char *entry_name, 00118 uint32 parentCode, 00119 uint32 tagCode, 00120 uint32 tagType, 00121 uint32 tagCount, 00122 const char *tag_name = NULL); 00123 00124 void DumpMatrix (const dng_matrix &m); 00125 00126 void DumpVector (const dng_vector &v); 00127 00128 void DumpDateTime (const dng_date_time &dt); 00129 00130 void DumpExposureTime (real64 x); 00131 00132 void DumpFingerprint (const dng_fingerprint &p); 00133 00134 void DumpHueSatMap (dng_stream &stream, 00135 uint32 hues, 00136 uint32 sats, 00137 uint32 vals, 00138 bool skipSat0); 00139 00140 /*****************************************************************************/ 00141 00142 #endif 00143 00144 /*****************************************************************************/ 00145 00146 bool CheckTagType (uint32 parentCode, 00147 uint32 tagCode, 00148 uint32 tagType, 00149 uint16 validType0, 00150 uint16 validType1 = 0, 00151 uint16 validType2 = 0, 00152 uint16 validType3 = 0); 00153 00154 bool CheckTagCount (uint32 parentCode, 00155 uint32 tagCode, 00156 uint32 tagCount, 00157 uint32 minCount, 00158 uint32 maxCount = 0); 00159 00160 bool CheckColorImage (uint32 parentCode, 00161 uint32 tagCode, 00162 uint32 colorPlanes); 00163 00164 bool CheckMainIFD (uint32 parentCode, 00165 uint32 tagCode, 00166 uint32 newSubFileType); 00167 00168 bool CheckRawIFD (uint32 parentCode, 00169 uint32 tagCode, 00170 uint32 photometricInterpretation); 00171 00172 bool CheckCFA (uint32 parentCode, 00173 uint32 tagCode, 00174 uint32 photometricInterpretation); 00175 00176 /*****************************************************************************/ 00177 00178 void ParseStringTag (dng_stream &stream, 00179 uint32 parentCode, 00180 uint32 tagCode, 00181 uint32 tagCount, 00182 dng_string &s, 00183 bool trimBlanks = true, 00184 bool isASCII = true); 00185 00186 void ParseDualStringTag (dng_stream &stream, 00187 uint32 parentCode, 00188 uint32 tagCode, 00189 uint32 tagCount, 00190 dng_string &s1, 00191 dng_string &s2); 00192 00193 void ParseEncodedStringTag (dng_stream &stream, 00194 uint32 parentCode, 00195 uint32 tagCode, 00196 uint32 tagCount, 00197 dng_string &s); 00198 00199 bool ParseMatrixTag (dng_stream &stream, 00200 uint32 parentCode, 00201 uint32 tagCode, 00202 uint32 tagType, 00203 uint32 tagCount, 00204 uint32 rows, 00205 uint32 cols, 00206 dng_matrix &m); 00207 00208 bool ParseVectorTag (dng_stream &stream, 00209 uint32 parentCode, 00210 uint32 tagCode, 00211 uint32 tagType, 00212 uint32 tagCount, 00213 uint32 count, 00214 dng_vector &v); 00215 00216 bool ParseDateTimeTag (dng_stream &stream, 00217 uint32 parentCode, 00218 uint32 tagCode, 00219 uint32 tagType, 00220 uint32 tagCount, 00221 dng_date_time &dt); 00222 00223 /*****************************************************************************/ 00224 00225 #endif 00226 00227 /*****************************************************************************/ |