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_xmp_sdk.h00001 /*****************************************************************************/ 00002 // Copyright 2006-2008 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_xmp_sdk.h#11 $ */ 00010 /* $DateTime: 2008/11/04 11:10:05 $ */ 00011 /* $Change: 518908 $ */ 00012 /* $Author: stern $ */ 00013 00014 /*****************************************************************************/ 00015 00016 #ifndef __dng_xmp_sdk__ 00017 #define __dng_xmp_sdk__ 00018 00019 /*****************************************************************************/ 00020 00021 #include "dng_auto_ptr.h" 00022 #include "dng_classes.h" 00023 #include "dng_flags.h" 00024 #include "dng_types.h" 00025 00026 /*****************************************************************************/ 00027 00028 extern const char *XMP_NS_TIFF; 00029 extern const char *XMP_NS_EXIF; 00030 extern const char *XMP_NS_PHOTOSHOP; 00031 extern const char *XMP_NS_XAP; 00032 extern const char *XMP_NS_DC; 00033 extern const char *XMP_NS_XMP_NOTE; 00034 00035 extern const char *XMP_NS_CRS; 00036 extern const char *XMP_NS_CRSS; 00037 00038 extern const char *XMP_NS_AUX; 00039 00040 extern const char *XMP_NS_IPTC; 00041 00042 extern const char *XMP_NS_CRX; 00043 00044 /*****************************************************************************/ 00045 00046 class dng_xmp_private; 00047 00048 /*****************************************************************************/ 00049 00050 typedef bool (IteratePathsCallback) (const char *ns, 00051 const char *path, 00052 void *callbackData); 00053 00054 /*****************************************************************************/ 00055 00056 struct dng_xmp_namespace 00057 { 00058 const char * fullName; 00059 const char * shortName; 00060 }; 00061 00062 /*****************************************************************************/ 00063 00064 class dng_xmp_sdk 00065 { 00066 00067 private: 00068 00069 dng_xmp_private *fPrivate; 00070 00071 public: 00072 00073 dng_xmp_sdk (); 00074 00075 dng_xmp_sdk (const dng_xmp_sdk &sdk); 00076 00077 virtual ~dng_xmp_sdk (); 00078 00079 static void InitializeSDK (dng_xmp_namespace * extraNamespaces = NULL); 00080 00081 static void TerminateSDK (); 00082 00083 bool HasMeta () const; 00084 00085 void Parse (dng_host &host, 00086 const char *buffer, 00087 uint32 count); 00088 00089 bool Exists (const char *ns, 00090 const char *path) const; 00091 00092 void AppendArrayItem (const char *ns, 00093 const char *arrayName, 00094 const char *itemValue, 00095 bool isBag = true, 00096 bool propIsStruct = false); 00097 00098 int32 CountArrayItems (const char *ns, 00099 const char *path) const; 00100 00101 bool HasNameSpace (const char *ns) const; 00102 00103 void Remove (const char *ns, 00104 const char *path); 00105 00106 void RemoveProperties (const char *ns); 00107 00108 void ComposeArrayItemPath (const char *ns, 00109 const char *arrayName, 00110 int32 itemNumber, 00111 dng_string &s) const; 00112 00113 void ComposeStructFieldPath (const char *ns, 00114 const char *structName, 00115 const char *fieldNS, 00116 const char *fieldName, 00117 dng_string &s) const; 00118 00119 bool GetNamespacePrefix (const char *uri, 00120 dng_string &s) const; 00121 00122 bool GetString (const char *ns, 00123 const char *path, 00124 dng_string &s) const; 00125 00126 void ValidateStringList (const char *ns, 00127 const char *path); 00128 00129 bool GetStringList (const char *ns, 00130 const char *path, 00131 dng_string_list &list) const; 00132 00133 bool GetAltLangDefault (const char *ns, 00134 const char *path, 00135 dng_string &s) const; 00136 00137 bool GetStructField (const char *ns, 00138 const char *path, 00139 const char *fieldNS, 00140 const char *fieldName, 00141 dng_string &s) const; 00142 00143 void Set (const char *ns, 00144 const char *path, 00145 const char *text); 00146 00147 void SetString (const char *ns, 00148 const char *path, 00149 const dng_string &s); 00150 00151 void SetStringList (const char *ns, 00152 const char *path, 00153 const dng_string_list &list, 00154 bool isBag); 00155 00156 void SetAltLangDefault (const char *ns, 00157 const char *path, 00158 const dng_string &s); 00159 00160 void SetStructField (const char *ns, 00161 const char *path, 00162 const char *fieldNS, 00163 const char *fieldName, 00164 const char *text); 00165 00166 void DeleteStructField (const char *ns, 00167 const char *structName, 00168 const char *fieldNS, 00169 const char *fieldName); 00170 00171 dng_memory_block * Serialize (dng_memory_allocator &allocator, 00172 bool asPacket, 00173 uint32 targetBytes, 00174 uint32 padBytes, 00175 bool forJPEG) const; 00176 00177 void PackageForJPEG (dng_memory_allocator &allocator, 00178 AutoPtr<dng_memory_block> &stdBlock, 00179 AutoPtr<dng_memory_block> &extBlock, 00180 dng_string &extDigest) const; 00181 00182 void MergeFromJPEG (const dng_xmp_sdk *xmp); 00183 00184 void AppendXMP (const dng_xmp_sdk *xmp); 00185 00186 void ReplaceXMP (dng_xmp_sdk *xmp); 00187 00188 bool IteratePaths (IteratePathsCallback *callback, 00189 void *callbackData = NULL, 00190 const char *startNS = 0, 00191 const char *startingPath = 0); 00192 00193 private: 00194 00195 void ClearMeta (); 00196 00197 void MakeMeta (); 00198 00199 void NeedMeta (); 00200 00201 // Hidden assignment operator. 00202 00203 dng_xmp_sdk & operator= (const dng_xmp_sdk &sdk); 00204 00205 }; 00206 00207 /*****************************************************************************/ 00208 00209 #endif 00210 00211 /*****************************************************************************/ |