TuttleOFX
1
|
00001 #ifndef _ofxCore_h_ 00002 #define _ofxCore_h_ 00003 00004 /* 00005 * Software License : 00006 * 00007 * Copyright (c) 2003-2009, The Open Effects Association Ltd. All rights reserved. 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions are met: 00011 * 00012 * Redistributions of source code must retain the above copyright notice, 00013 * this list of conditions and the following disclaimer. 00014 * Redistributions in binary form must reproduce the above copyright notice, 00015 * this list of conditions and the following disclaimer in the documentation 00016 * and/or other materials provided with the distribution. 00017 * Neither the name The Open Effects Association Ltd, nor the names of its 00018 * contributors may be used to endorse or promote products derived from this 00019 * software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00022 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00023 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00024 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 00025 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00026 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00027 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00028 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00029 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00030 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 */ 00032 00033 #include "ofxCorePlugin.h" 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00039 /** @file ofxCore.h 00040 Contains the core OFX architectural struct and function definitions. For more details on the basic OFX architecture, see \ref Architecture. 00041 */ 00042 /*@{*/ 00043 /** @brief Action called to have a plug-in purge any temporary caches it may have allocated \ref ArchitectureMainFunction and \ref ActionsGeneralPurgeCaches */ 00044 #define kOfxActionPurgeCaches "OfxActionPurgeCaches" 00045 00046 /** @brief Action called to have a plug-in sync any internal data structures into custom parameters */ 00047 #define kOfxActionSyncPrivateData "OfxActionSyncPrivateData" 00048 00049 /** @brief Action indicating something in the instance has been changed, see \ref ActionsGeneralInstanceChanged */ 00050 #define kOfxActionInstanceChanged "OfxActionInstanceChanged" 00051 00052 /** @brief Action called before the start of a set of kOfxActionEndInstanceChanged actions, used with ::kOfxActionEndInstanceChanged to bracket a grouped set of changes, see \ref ActionsGeneralInstanceChangedBeginEnd */ 00053 #define kOfxActionBeginInstanceChanged "OfxActionBeginInstanceChanged" 00054 00055 /** @brief Action called after the end of a set of kOfxActionEndInstanceChanged actions, used with ::kOfxActionBeginInstanceChanged to bracket a grouped set of changes, see \ref ActionsGeneralInstanceChangedBeginEnd*/ 00056 #define kOfxActionEndInstanceChanged "OfxActionEndInstanceChanged" 00057 00058 /** @brief Action called when an instance has the first editor opened for it */ 00059 #define kOfxActionBeginInstanceEdit "OfxActionBeginInstanceEdit" 00060 00061 /** @brief Action called when an instance has the last editor closed */ 00062 #define kOfxActionEndInstanceEdit "OfxActionEndInstanceEdit" 00063 00064 /*@}*/ 00065 00066 /** 00067 * \defgroup PropertiesAll Ofx Properties 00068 * 00069 * These strings are used to identify properties within OFX, they are broken up by the host suite or API they relate to. 00070 */ 00071 /*@{*/ 00072 00073 /** 00074 * \defgroup PropertiesGeneral General Properties 00075 * 00076 * These properties are general properties and apply to may objects across OFX 00077 */ 00078 /*@{*/ 00079 00080 /** @brief Property on the host descriptor, saying what API version of the API is being implemented 00081 * 00082 * - Type - int X N 00083 * - Property Set - host descriptor. 00084 * 00085 * This is a version string that will specify which version of the API is being implemented by a host. It 00086 * can have multiple values. For example "1.0", "1.2.4" etc..... 00087 * 00088 * If this is not present, it is safe to assume that the version of the API is "1.0". 00089 */ 00090 #define kOfxPropAPIVersion "OfxPropAPIVersion" 00091 00092 /** @brief General property used to get/set the time of something. 00093 * 00094 * - Type - double X 1 00095 * - Default - 0, if a setable property 00096 * - Property Set - commonly used as an argument to actions, input and output. 00097 */ 00098 #define kOfxPropTime "OfxPropTime" 00099 00100 /** @brief Indicates if a host is actively editing the effect with some GUI. 00101 * 00102 * - Type - int X 1 00103 * - Property Set - effect instance (read only) 00104 * - Valid Values - 0 or 1 00105 * 00106 * If false the effect currently has no interface, however this may be because the effect is loaded in a background render host, or it may be loaded on an interactive host that has not yet opened an editor for the effect. 00107 * 00108 * The output of an effect should only ever depend on the state of its parameters, not on the interactive flag. The interactive flag is more a courtesy flag to let a plugin know that it has an interface. If a plugin want's to have its behaviour dependant on the interactive flag, it can always make a secret parameter which shadows the state of the flag. 00109 */ 00110 #define kOfxPropIsInteractive "OfxPropIsInteractive" 00111 00112 /** @brief The file path to the plugin. 00113 * 00114 * - Type - C string X 1 00115 * - Property Set - effect descriptor (read only) 00116 * 00117 * This is a string that indicates the file path where the plug-in was found by the host. The path is in the native 00118 * path format for the host OS (eg: UNIX directory separators are forward slashes, Windows ones are backslashes). 00119 * 00120 * The path is to the bundle location, see \ref InstallationLocation. 00121 * eg: '/usr/OFX/Plugins/AcmePlugins/AcmeFantasticPlugin.ofx.bundle' 00122 */ 00123 #define kOfxPluginPropFilePath "OfxPluginPropFilePath" 00124 00125 /** @brief A private data pointer that the plug-in can store its own data behind. 00126 * 00127 * - Type - pointer X 1 00128 * - Property Set - plugin instance (read/write), 00129 * - Default - NULL 00130 * 00131 * This data pointer is unique to each plug-in instance, so two instances of the same plug-in do not share the same data pointer. Use it to hang any needed private data structures. 00132 */ 00133 #define kOfxPropInstanceData "OfxPropInstanceData" 00134 00135 /** @brief General property, used to identify the kind of an object behind a handle 00136 * 00137 * - Type - ASCII C string X 1 00138 * - Property Set - any object handle (read only) 00139 * - Valid Values - currently this can be... 00140 * - ::kOfxTypeImageEffectHost 00141 * - ::kOfxTypeImageEffect 00142 * - ::kOfxTypeImageEffectInstance 00143 * - ::kOfxTypeParameter 00144 * - ::kOfxTypeParameterInstance 00145 * - ::kOfxTypeClip 00146 * - ::kOfxTypeImage 00147 */ 00148 #define kOfxPropType "OfxPropType" 00149 00150 /** @brief Unique name of an object. 00151 * 00152 * - Type - ASCII C string X 1 00153 * - Property Set - on many objects (descriptors and instances), see \ref PropertiesByObject (read only) 00154 * 00155 * This property is used to label objects uniquely amoung objects of that type. It is typically set when a plugin creates a new object with a function that takes a name. 00156 */ 00157 #define kOfxPropName "OfxPropName" 00158 00159 /** @brief Identifies a specific version of a host or plugin. 00160 00161 - Type - int X N 00162 - Property Set - host descriptor (read only), plugin descriptor (read/write) 00163 - Default - "0" 00164 - Valid Values - positive integers 00165 00166 This is a multi dimensional integer property that represents the version of a host (host descriptor), or plugin (plugin descriptor). These represent a version number of the form '1.2.3.4', with each dimension adding another 'dot' on the right. 00167 00168 A version is considered to be more recent than another if its ordered set of values is lexicographically greater than another, reading left to right. (ie: 1.2.4 is smaller than 1.2.6). Also, if the number of dimensions is different, then the values of the missing dimensions are considered to be zero (so 1.2.4 is greater than 1.2). 00169 */ 00170 #define kOfxPropVersion "OfxPropVersion" 00171 00172 /** @brief Unique user readable version string of a plugin or host. 00173 00174 - Type - string X 1 00175 - Property Set - host descriptor (read only), plugin descriptor (read/write) 00176 - Default - none, the host needs to set this 00177 - Valid Values - ASCII string 00178 00179 This is purely for user feedback, a plugin or host should use ::kOfxPropVersion if they need 00180 to check for specific versions. 00181 */ 00182 #define kOfxPropVersionLabel "OfxPropVersionLabel" 00183 00184 /** @brief Description of the plug-in to a user. 00185 00186 - Type - string X 1 00187 - Property Set - plugin descriptor (read/write) and instance (read only) 00188 - Default - "" 00189 - Valid Values - UTF8 string 00190 - API >= 1.2 00191 00192 This is a string giving a potentially verbose description of the effect. 00193 */ 00194 #define kOfxPropPluginDescription "OfxPropPluginDescription" 00195 00196 /** @brief User visible name of an object. 00197 * 00198 * - Type - UTF8 C string X 1 00199 * - Property Set - on many objects (descriptors and instances), see \ref PropertiesByObject. Typically readable and writable in most cases. 00200 * - Default - the ::kOfxPropName the object was created with. 00201 * 00202 * The label is what a user sees on any interface in place of the object's name. 00203 * 00204 * Note that resetting this will also reset ::kOfxPropShortLabel and ::kOfxPropLongLabel. 00205 */ 00206 #define kOfxPropLabel "OfxPropLabel" 00207 00208 /** @brief If set this tells the host to use an icon instead of a label for some object in the interface. 00209 00210 - Type - string X 2 00211 - Property Set - various descriptors in the API 00212 - Default - "" 00213 - Valid Values - ASCII string 00214 00215 The value is a path is defined relative to the Resource folder that points to an SVG or PNG file containing the icon. 00216 00217 The first dimension, if set, will the name of an SVG file, the second a PNG file. 00218 */ 00219 #define kOfxPropIcon "OfxPropIcon" 00220 00221 /** @brief Short user visible name of an object. 00222 * 00223 * - Type - UTF8 C string X 1 00224 * - Property Set - on many objects (descriptors and instances), see \ref PropertiesByObject. Typically readable and writable in most cases. 00225 * - Default - initially ::kOfxPropName, but will be reset if ::kOfxPropLabel is changed. 00226 * 00227 * This is a shorter version of the label, typically 13 character glyphs or less. Hosts should use this if they have limitted display space for their object labels. 00228 */ 00229 #define kOfxPropShortLabel "OfxPropShortLabel" 00230 00231 /** @brief Long user visible name of an object. 00232 * 00233 * - Type - UTF8 C string X 1 00234 * - Property Set - on many objects (descriptors and instances), see \ref PropertiesByObject. Typically readable and writable in most cases. 00235 * - Default - initially ::kOfxPropName, but will be reset if ::kOfxPropLabel is changed. 00236 * 00237 * This is a longer version of the label, typically 32 character glyphs or so. Hosts should use this if they have mucg display space for their object labels. 00238 */ 00239 #define kOfxPropLongLabel "OfxPropLongLabel" 00240 00241 /** @brief Indicates why a plug-in changed. 00242 * 00243 * - Type - ASCII C string X 1 00244 * - Property Set - the inArgs parameter on the ::kOfxActionInstanceChanged action. 00245 * - Valid Values - this can be... 00246 * - ::kOfxChangeUserEdited - the user directly edited the instance somehow and caused a change to something, this includes undo/redos and resets 00247 * - ::kOfxChangePluginEdited - the plug-in itself has changed the value of the object in some action 00248 * - ::kOfxChangeTime - the time has changed and this has affected the value of the object because it varies over time 00249 * 00250 * Argument property for the ::kOfxActionInstanceChanged action. 00251 */ 00252 #define kOfxPropChangeReason "OfxPropChangeReason" 00253 00254 /** @brief A pointer to an effect instance. 00255 * 00256 * - Type - pointer X 1 00257 * - Property Set - on an interact instance (read only) 00258 * 00259 * This property is used to link an object to the effect. For example if the plug-in supplies an openGL overlay for an image effect, 00260 * the interact instance will have one of these so that the plug-in can connect back to the effect the GUI links to. 00261 */ 00262 #define kOfxPropEffectInstance "OfxPropEffectInstance" 00263 00264 /** @brief A pointer to an operating system specific application handle. 00265 00266 - Type - pointer X 1 00267 - Property Set - host descriptor. 00268 00269 Some plug-in vendor want raw OS specific handles back from the host so they can do interesting things with host OS APIs. Typically this is to control windowing properly on Microsoft Windows. This property returns the appropriate 'root' window handle on the current operating system. So on Windows this would be the hWnd of the application main window. 00270 */ 00271 #define kOfxPropHostOSHandle "OfxPropHostOSHandle" 00272 00273 /*@}*/ 00274 00275 /*@}*/ 00276 00277 /** @brief String used as a value to ::kOfxPropChangeReason to indicate a user has changed something */ 00278 #define kOfxChangeUserEdited "OfxChangeUserEdited" 00279 00280 /** @brief String used as a value to ::kOfxPropChangeReason to indicate the plug-in itself has changed something */ 00281 #define kOfxChangePluginEdited "OfxChangePluginEdited" 00282 00283 /** @brief String used as a value to ::kOfxPropChangeReason to a time varying object has changed due to a time change */ 00284 #define kOfxChangeTime "OfxChangeTime" 00285 00286 /** @brief How time is specified within the OFX API */ 00287 typedef double OfxTime; 00288 00289 /** @brief Defines one dimensional integer bounds */ 00290 typedef struct OfxRangeI 00291 { 00292 int min, max; 00293 } OfxRangeI; 00294 00295 /** @brief Defines one dimensional double bounds */ 00296 typedef struct OfxRangeD 00297 { 00298 double min, max; 00299 } OfxRangeD; 00300 00301 /** @brief Defines two dimensional integer point */ 00302 typedef struct OfxPointI 00303 { 00304 int x, y; 00305 } OfxPointI; 00306 00307 /** @brief Defines two dimensional double point */ 00308 typedef struct OfxPointD 00309 { 00310 double x, y; 00311 } OfxPointD; 00312 00313 /** @brief Used to flag infinite rects. Set minimums to this to indicate infinite 00314 * 00315 */ 00316 #define kOfxFlagInfiniteMax INT_MAX 00317 00318 /** @brief Used to flag infinite rects. Set minimums to this to indicate infinite. 00319 * 00320 */ 00321 #define kOfxFlagInfiniteMin INT_MIN 00322 00323 /** @brief Defines two dimensional integer region 00324 * 00325 * Regions are x1 <= x < x2 00326 * 00327 * Infinite regions are flagged by setting 00328 * - x1 = kOfxFlagInfiniteMin 00329 * - y1 = kOfxFlagInfiniteMin 00330 * - x2 = kOfxFlagInfiniteMax 00331 * - y2 = kOfxFlagInfiniteMax 00332 * 00333 */ 00334 typedef struct OfxRectI 00335 { 00336 int x1, y1, x2, y2; 00337 } OfxRectI; 00338 00339 /** @brief Defines two dimensional double region 00340 * 00341 * Regions are x1 <= x < x2 00342 * 00343 * Infinite regions are flagged by setting 00344 * - x1 = kOfxFlagInfiniteMin 00345 * - y1 = kOfxFlagInfiniteMin 00346 * - x2 = kOfxFlagInfiniteMax 00347 * - y2 = kOfxFlagInfiniteMax 00348 * 00349 */ 00350 typedef struct OfxRectD 00351 { 00352 double x1, y1, x2, y2; 00353 } OfxRectD; 00354 00355 /** @brief Defines an integer 3D point 00356 * 00357 * Should migrate this to the ofxCore.h in a v1.1 00358 * @todo tuttle: ofxtuttle fix (move here) 00359 */ 00360 struct Ofx3DPointI 00361 { 00362 int x, y, z; 00363 }; 00364 00365 /** @brief Defines a double precision 3D point 00366 * 00367 * Should migrate this to the ofxCore.h in a v1.1 00368 * @todo tuttle: ofxtuttle fix (move here) 00369 */ 00370 struct Ofx3DPointD 00371 { 00372 double x, y, z; 00373 }; 00374 00375 /** @brief String used to label unset bitdepths */ 00376 #define kOfxBitDepthNone "OfxBitDepthNone" 00377 00378 /** @brief String used to label unsigned 8 bit integer samples */ 00379 #define kOfxBitDepthByte "OfxBitDepthByte" 00380 00381 /** @brief String used to label unsigned 16 bit integer samples */ 00382 #define kOfxBitDepthShort "OfxBitDepthShort" 00383 00384 /** @brief String used to label signed 32 bit floating point samples */ 00385 #define kOfxBitDepthFloat "OfxBitDepthFloat" 00386 00387 /** 00388 * \defgroup StatusCodes Status Codes 00389 * 00390 * These strings are used to identify error states within ofx, they are returned 00391 * by various host suite functions, as well as plug-in functions. The valid return codes 00392 * for each function are documented with that function. 00393 */ 00394 /*@{*/ 00395 00396 /** 00397 * \defgroup StatusCodesGeneral General Status Codes 00398 * 00399 * General status codes start at 1 and continue until 999 00400 * 00401 */ 00402 /*@{*/ 00403 00404 #ifdef __cplusplus 00405 } 00406 #endif 00407 00408 /** @mainpage OFX : Open Plug-Ins For Special Effects 00409 * 00410 * This page represents the automatically extracted HTML documentation of the source headers for the OFX Image Effect API. The documentation was extracted by doxygen (http://www.doxygen.org). It breaks documentation into sets of pages, use the links at the top of this page (marked 'Modules', 'Compound List' and especially 'File List' etcc) to browse through the OFX doc. 00411 * 00412 * A more complete reference manual is http://openfx.sourceforge.net . 00413 * 00414 */ 00415 00416 #endif