TuttleOFX
1
|
00001 #ifndef _ofxImageEffect_h_ 00002 #define _ofxImageEffect_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 "ofxCore.h" 00034 #include "ofxAttribute.h" 00035 #include "ofxClip.h" 00036 #include "ofxParam.h" 00037 #include "ofxInteract.h" 00038 #include "ofxMessage.h" 00039 #include "ofxMemory.h" 00040 #include "ofxMultiThread.h" 00041 #include "ofxInteract.h" 00042 #include "extensions/tuttle/ofxReadWrite.h" 00043 00044 #ifdef __cplusplus 00045 extern "C" { 00046 #endif 00047 00048 /** @brief String used to label OFX Image Effect Plug-ins 00049 * 00050 * Set the pluginApi member of the OfxPluginHeader inside any OfxImageEffectPluginStruct 00051 * to be this so that the host knows the plugin is an image effect. 00052 */ 00053 #define kOfxImageEffectPluginApi "OfxImageEffectPluginAPI" 00054 00055 /** @brief The current version of the Image Effect API 00056 */ 00057 #define kOfxImageEffectPluginApiVersion 1 00058 00059 /** @brief Blind declaration of an OFX image effect 00060 */ 00061 typedef struct OfxImageEffectStruct* OfxImageEffectHandle; 00062 00063 /** @brief Blind declaration of an OFX image effect 00064 */ 00065 typedef struct OfxImageClipStruct* OfxImageClipHandle; 00066 00067 /** @brief Blind declaration for an handle to image memory returned by the image memory management routines */ 00068 typedef struct OfxImageMemoryStruct* OfxImageMemoryHandle; 00069 00070 /** @brief String to label something with unset components */ 00071 #define kOfxImageComponentNone "OfxImageComponentNone" 00072 00073 /** @brief String to label images with RGBA components */ 00074 #define kOfxImageComponentRGBA "OfxImageComponentRGBA" 00075 00076 /** @brief String to label images with RGB components */ 00077 #define kOfxImageComponentRGB "OfxImageComponentRGB" 00078 00079 /** @brief String to label images with only Alpha components */ 00080 #define kOfxImageComponentAlpha "OfxImageComponentAlpha" 00081 00082 /** @brief String to label images with YUVA components 00083 00084 Note, this has been deprecated. 00085 */ 00086 #define kOfxImageComponentYUVA "OfxImageComponentYUVA" 00087 00088 /** @brief Use to define the generator image effect context. See \ref ImageEffectContexts 00089 */ 00090 #define kOfxImageEffectContextGenerator "OfxImageEffectContextGenerator" 00091 00092 /** @brief Use to define the filter effect image effect context See \ref ImageEffectContexts */ 00093 #define kOfxImageEffectContextFilter "OfxImageEffectContextFilter" 00094 00095 /** @brief Use to define the transition image effect context See \ref ImageEffectContexts */ 00096 #define kOfxImageEffectContextTransition "OfxImageEffectContextTransition" 00097 00098 /** @brief Use to define the paint image effect context See \ref ImageEffectContexts */ 00099 #define kOfxImageEffectContextPaint "OfxImageEffectContextPaint" 00100 00101 /** @brief Use to define the general image effect context See \ref ImageEffectContexts */ 00102 #define kOfxImageEffectContextGeneral "OfxImageEffectContextGeneral" 00103 00104 /** @brief Use to define the retimer effect context See \ref ImageEffectContexts */ 00105 #define kOfxImageEffectContextRetimer "OfxImageEffectContextRetimer" 00106 00107 /** @brief Use to define the reader effect context See \ref ImageEffectContexts */ 00108 #define kOfxImageEffectContextReader "OfxImageEffectContextReader" 00109 00110 /** @brief Use to define the writer effect context See \ref ImageEffectContexts */ 00111 #define kOfxImageEffectContextWriter "OfxImageEffectContextWriter" 00112 00113 /** @brief Used as a value for ::kOfxPropType on image effect host handles */ 00114 #define kOfxTypeImageEffectHost "OfxTypeImageEffectHost" 00115 00116 /** @brief Used as a value for ::kOfxPropType on image effect plugin handles */ 00117 #define kOfxTypeImageEffect "OfxTypeImageEffect" 00118 00119 /** @brief Used as a value for ::kOfxPropType on image effect instance handles */ 00120 #define kOfxTypeImageEffectInstance "OfxTypeImageEffectInstance" 00121 00122 /** @brief Used as a value for ::kOfxPropType on image effect clips */ 00123 #define kOfxTypeClip "OfxTypeClip" 00124 00125 /** @brief Used as a value for ::kOfxPropType on image effect images */ 00126 #define kOfxTypeImage "OfxTypeImage" 00127 00128 /** 00129 * \addtogroup ActionsAll 00130 */ 00131 /*@{*/ 00132 /** 00133 * \defgroup ImageEffectActions Image Effect Actions 00134 * 00135 * These are the list of actions passed to an image effect plugin's main function. For more details on how to deal with actions, see \ref ImageEffectActions. 00136 */ 00137 /*@{*/ 00138 00139 /** @brief Action called to get the region of definition of an effect */ 00140 #define kOfxImageEffectActionGetRegionOfDefinition "OfxImageEffectActionGetRegionOfDefinition" 00141 00142 /** @brief Action called to get the regions of interest of an effect */ 00143 #define kOfxImageEffectActionGetRegionsOfInterest "OfxImageEffectActionGetRegionsOfInterest" 00144 00145 /** @brief Action called to get the temporal domain of an effect */ 00146 #define kOfxImageEffectActionGetTimeDomain "OfxImageEffectActionGetTimeDomain" 00147 00148 /** @brief Action called to get the frame ranged needed on an input clip to render a single frame */ 00149 #define kOfxImageEffectActionGetFramesNeeded "OfxImageEffectActionGetFramesNeeded" 00150 00151 /** @brief Action called to have a plug-in define input an output clip preferences */ 00152 #define kOfxImageEffectActionGetClipPreferences "OfxImageEffectActionGetClipPreferences" 00153 00154 /** @brief Action called to have a plug-in say if it is an identity transform */ 00155 #define kOfxImageEffectActionIsIdentity "OfxImageEffectActionIsIdentity" 00156 00157 /** @brief Action to render an image */ 00158 #define kOfxImageEffectActionRender "OfxImageEffectActionRender" 00159 00160 /** @brief Action indicating a series of render calls are about to happen */ 00161 #define kOfxImageEffectActionBeginSequenceRender "OfxImageEffectActionBeginSequenceRender" 00162 00163 /** @brief Action to render a series of render calls have completed */ 00164 #define kOfxImageEffectActionEndSequenceRender "OfxImageEffectActionEndSequenceRender" 00165 00166 /** @brief Action to describe an image effect in a specific context */ 00167 #define kOfxImageEffectActionDescribeInContext "OfxImageEffectActionDescribeInContext" 00168 00169 /*@}*/ 00170 /*@}*/ 00171 00172 /** 00173 * \addtogroup PropertiesAll 00174 */ 00175 /*@{*/ 00176 /** 00177 * \defgroup ImageEffectPropDefines Image Effect Property Definitions 00178 * 00179 * These are the list of properties used by the Image Effects API. 00180 */ 00181 /*@{*/ 00182 /** @brief Indicates to the host the contexts a plugin can be used in. 00183 * 00184 * - Type - string X N 00185 * - Property Set - image effect descriptor passed to kOfxActionDescribe (read/write) 00186 * - Default - this has no defaults, it must be set 00187 * - Valid Values - This must be one of 00188 * - ::kOfxImageEffectContextGenerator 00189 * - ::kOfxImageEffectContextFilter 00190 * - ::kOfxImageEffectContextTransition 00191 * - ::kOfxImageEffectContextPaint 00192 * - ::kOfxImageEffectContextGeneral 00193 * - ::kOfxImageEffectContextRetimer 00194 */ 00195 #define kOfxImageEffectPropSupportedContexts "OfxImageEffectPropSupportedContexts" 00196 00197 /** @brief The plugin handle passed to the initial 'describe' action. 00198 * 00199 * - Type - pointer X 1 00200 * - Property Set - plugin instance, (read only) 00201 * 00202 * This value will be the same for all instances of a plugin. 00203 */ 00204 #define kOfxImageEffectPropPluginHandle "OfxImageEffectPropPluginHandle" 00205 00206 /** @brief Indicates if a host is a background render. 00207 * 00208 * - Type - int X 1 00209 * - Property Set - host descriptor (read only) 00210 * - Valid Values - This must be one of 00211 * - 0 if the host is a foreground host, it may open the effect in an interactive session (or not) 00212 * - 1 if the host is a background 'processing only' host, and the effect will never be opened in an interactive session. 00213 */ 00214 #define kOfxImageEffectHostPropIsBackground "OfxImageEffectHostPropIsBackground" 00215 00216 /** @brief Indicates whether only one instance of a plugin can exist at the same time 00217 * 00218 * - Type - int X 1 00219 * - Property Set - plugin descriptor (read/write) 00220 * - Default - 0 00221 * - Valid Values - This must be one of 00222 * - 0 - which means multiple instances can exist simultaneously, 00223 * - 1 - which means only one instance can exist at any one time. 00224 * 00225 * Some plugins, for whatever reason, may only be able to have a single instance in existance at any one time. This plugin property is used to indicate that. 00226 */ 00227 #define kOfxImageEffectPluginPropSingleInstance "OfxImageEffectPluginPropSingleInstance" 00228 00229 /** @brief Indicates how many simultaneous renders the plugin can deal with. 00230 * 00231 * - Type - string X 1 00232 * - Property Set - plugin descriptor (read/write) 00233 * - Default - ::kOfxImageEffectRenderInstanceSafe 00234 * - Valid Values - This must be one of 00235 * - ::kOfxImageEffectRenderUnsafe - indicating that only a single 'render' call can be made at any time amoung all instances, 00236 * - ::kOfxImageEffectRenderInstanceSafe - indicating that any instance can have a single 'render' call at any one time, 00237 * - ::kOfxImageEffectRenderFullySafe - indicating that any instance of a plugin can have multiple renders running simultaneously 00238 */ 00239 #define kOfxImageEffectPluginRenderThreadSafety "OfxImageEffectPluginRenderThreadSafety" 00240 00241 /** @brief String used to label render threads as un thread safe, see, \ref ::kOfxImageEffectPluginRenderThreadSafety */ 00242 #define kOfxImageEffectRenderUnsafe "OfxImageEffectRenderUnsafe" 00243 /** @brief String used to label render threads as instance thread safe, \ref ::kOfxImageEffectPluginRenderThreadSafety */ 00244 #define kOfxImageEffectRenderInstanceSafe "OfxImageEffectRenderInstanceSafe" 00245 /** @brief String used to label render threads as fully thread safe, \ref ::kOfxImageEffectPluginRenderThreadSafety */ 00246 #define kOfxImageEffectRenderFullySafe "OfxImageEffectRenderFullySafe" 00247 00248 /** @brief Indicates whether a plugin lets the host perform per frame SMP threading 00249 * 00250 * - Type - int X 1 00251 * - Property Set - plugin descriptor (read/write) 00252 * - Default - 1 00253 * - Valid Values - This must be one of 00254 * - 0 - which means that the plugin will perform any per frame SMP threading 00255 * - 1 - which means the host can call an instance's render function simultaneously at the same frame, but with different windows to render. 00256 */ 00257 #define kOfxImageEffectPluginPropHostFrameThreading "OfxImageEffectPluginPropHostFrameThreading" 00258 00259 /** @brief Indicates whether a host or plugin can support clips of differing component depths going into/out of an effect 00260 * 00261 * - Type - int X 1 00262 * - Property Set - plugin descriptor (read/write), host descriptor (read only) 00263 * - Default - 0 for a plugin 00264 * - Valid Values - This must be one of 00265 * - 0 - in which case the host or plugin does not support clips of multiple pixel depths, 00266 * - 1 - which means a host or plugin is able to to deal with clips of multiple pixel depths, 00267 * 00268 * If a host indicates that it can support multiple pixels depths, then it will allow the plugin to explicitly set 00269 * the output clip's pixel depth in the ::kOfxImageEffectActionGetClipPreferences action. See \ref ImageEffectClipPreferences. 00270 */ 00271 #define kOfxImageEffectPropSupportsMultipleClipDepths "OfxImageEffectPropMultipleClipDepths" 00272 00273 /** @brief Indicates whether a host or plugin can support clips of differing pixel aspect ratios going into/out of an effect 00274 * 00275 * - Type - int X 1 00276 * - Property Set - plugin descriptor (read/write), host descriptor (read only) 00277 * - Default - 0 for a plugin 00278 * - Valid Values - This must be one of 00279 * - 0 - in which case the host or plugin does not support clips of multiple pixel aspect ratios 00280 * - 1 - which means a host or plugin is able to to deal with clips of multiple pixel aspect ratios 00281 * 00282 * If a host indicates that it can support multiple pixel aspect ratios, then it will allow the plugin to explicitly set 00283 * the output clip's aspect ratio in the ::kOfxImageEffectActionGetClipPreferences action. See \ref ImageEffectClipPreferences. 00284 */ 00285 #define kOfxImageEffectPropSupportsMultipleClipPARs "OfxImageEffectPropSupportsMultipleClipPARs" 00286 00287 00288 /** @brief Indicates the set of parameters on which a value change will trigger a change to clip preferences 00289 * 00290 * - Type - string X N 00291 * - Property Set - plugin descriptor (read/write) 00292 * - Default - none set 00293 * - Valid Values - the name of any described parameter 00294 * 00295 * The plugin uses this to inform the host of the subset of parameters that affect the effect's clip preferences. A value change in any one of these will trigger a call to the clip preferences action. 00296 * 00297 * The plugin can be slaved to multiple parameters (setting index 0, then index 1 etc...) 00298 */ 00299 #define kOfxImageEffectPropClipPreferencesSlaveParam "OfxImageEffectPropClipPreferencesSlaveParam" 00300 00301 /** @brief Indicates whether the host will let a plugin set the frame rate of the output clip. 00302 * 00303 * - Type - int X 1 00304 * - Property Set - host descriptor (read only) 00305 * - Valid Values - This must be one of 00306 * - 0 - in which case the plugin may not change the frame rate of the output clip, 00307 * - 1 - which means a plugin is able to change the output clip's frame rate in the ::kOfxImageEffectActionGetClipPreferences action. 00308 * 00309 * See \ref ImageEffectClipPreferences. 00310 * 00311 * If a clip can be continously sampled, the frame rate will be set to 0. 00312 */ 00313 #define kOfxImageEffectPropSetableFrameRate "OfxImageEffectPropSetableFrameRate" 00314 00315 /** @brief Indicates whether the host will let a plugin set the fielding of the output clip. 00316 * 00317 * - Type - int X 1 00318 * - Property Set - host descriptor (read only) 00319 * - Valid Values - This must be one of 00320 * - 0 - in which case the plugin may not change the fielding of the output clip, 00321 * - 1 - which means a plugin is able to change the output clip's fielding in the ::kOfxImageEffectActionGetClipPreferences action. 00322 * 00323 * See \ref ImageEffectClipPreferences. 00324 */ 00325 #define kOfxImageEffectPropSetableFielding "OfxImageEffectPropSetableFielding" 00326 00327 /** @brief Indicates whether a plugin needs sequential rendering, and a host support it 00328 * 00329 * - Type - int X 1 00330 * - Property Set - plugin descriptor (read/write) or plugin instance (read/write), and host descriptor (read only) 00331 * - Default - 0 00332 * - Valid Values - 00333 * - 0 - for a plugin, indicates that a plugin does not need to be sequentially rendered to be correct, for a host, indicates that it cannot ever guarantee sequential rendering, 00334 * - 1 - for a plugin, indicates that it needs to be sequentially rendered to be correct, for a host, indicates that it can always support sequential rendering of plugins that are sequentially rendered, 00335 * - 2 - for a plugin, indicates that it is best to render sequentially, but will still produce correct results if not, for a host, indicates that it can sometimes render sequentially, and will have set ::kOfxImageEffectPropSequentialRenderStatus on the relevant actions 00336 * 00337 * Some effects have temporal dependancies, some information from from the rendering of frame N-1 is needed to render frame N correctly. This property is set by an effect to indicate such a situation. Also, some effects are more efficient if they run sequentially, but can still render correct images even if they do not, eg: a complex particle system. 00338 * 00339 * During an interactive session a host may attempt to render a frame out of sequence (for example when the user scrubs the current time), and the effect needs to deal with such a situation as best it can to provide feedback to the user. 00340 * 00341 * However if a host caches output, any frame frame generated in random temporal order needs to be considered invalid and needs to be re-rendered when the host finally performs a first to last render of the output sequence. 00342 * 00343 * In all cases, a host will set the kOfxImageEffectPropSequentialRenderStatus flag to indicate its sequential render status. 00344 */ 00345 #define kOfxImageEffectInstancePropSequentialRender "OfxImageEffectInstancePropSequentialRender" 00346 00347 /** @brief Property on all the render action that indicate the current sequential render status of a host 00348 * 00349 * - Type - int X 1 00350 * - Property Set - read only property on the inArgs of the following actions... 00351 * - ::kOfxImageEffectActionBeginSequenceRender 00352 * - ::kOfxImageEffectActionRender 00353 * - ::kOfxImageEffectActionEndSequenceRender 00354 * - Valid Values - 00355 * - 0 - the host is not currently sequentially rendering, 00356 * - 1 - the host is currentely rendering in a way so that it guarantees sequential rendering. 00357 * 00358 * This property is set to indicate whether the effect is currently being rendered in frame order on a single effect instance. See ::kOfxImageEffectInstancePropSequentialRender for more details on sequential rendering. 00359 */ 00360 #define kOfxImageEffectPropSequentialRenderStatus "OfxImageEffectPropSequentialRenderStatus" 00361 00362 /** @brief Property that indicates if a plugin is being rendered in response to user interaction. 00363 * 00364 * - Type - int X 1 00365 * - Property Set - read only property on the inArgs of the following actions... 00366 * - ::kOfxImageEffectActionBeginSequenceRender 00367 * - ::kOfxImageEffectActionRender 00368 * - ::kOfxImageEffectActionEndSequenceRender 00369 * - Valid Values - 00370 * - 0 - the host is rendering the instance due to some reason other than an interactive tweak on a UI, 00371 * - 1 - the instance is being rendered because a user is modifying parameters in an interactive session. 00372 * 00373 * This property is set to 1 on all render calls that have been triggered because a user is actively modifying an effect (or up stream effect) in an interactive session. This typically means that the effect is not being rendered as a part of a sequence, but as a single frame. 00374 */ 00375 #define kOfxImageEffectPropInteractiveRenderStatus "OfxImageEffectPropInteractiveRenderStatus" 00376 00377 /** @brief Indicates the effect group for this plugin. 00378 * 00379 * - Type - UTF8 string X 1 00380 * - Property Set - plugin descriptor (read/write) 00381 * - Default - "" 00382 * 00383 * This is purely a user interface hint for the host so it can group related effects on any menus it may have. 00384 */ 00385 #define kOfxImageEffectPluginPropGrouping "OfxImageEffectPluginPropGrouping" 00386 00387 /** @brief Indicates whether a host support image effect \ref ImageEffectOverlays. 00388 * 00389 * - Type - int X 1 00390 * - Property Set - host descriptor (read only) 00391 * - Valid Values - This must be one of 00392 * - 0 - the host won't allow a plugin to draw a GUI over the output image, 00393 * - 1 - the host will allow a plugin to draw a GUI over the output image. 00394 */ 00395 #define kOfxImageEffectPropSupportsOverlays "OfxImageEffectPropSupportsOverlays" 00396 00397 /** @brief Sets the entry for an effect's overlay interaction 00398 * 00399 * - Type - pointer X 1 00400 * - Property Set - plugin descriptor (read/write) 00401 * - Default - NULL 00402 * - Valid Values - must point to an ::OfxPluginEntryPoint 00403 * 00404 * The entry point pointed to must be one that handles custom interaction actions. 00405 */ 00406 #define kOfxImageEffectPluginPropOverlayInteractV1 "OfxImageEffectPluginPropOverlayInteractV1" 00407 00408 /** @brief Indicates whether a plugin or host support multiple resolution images. 00409 * 00410 * - Type - int X 1 00411 * - Property Set - host descriptor (read only), plugin descriptor (read/write) 00412 * - Default - 1 for plugins 00413 * - Valid Values - This must be one of 00414 * - 0 - the plugin or host does not support multiple resolutions 00415 * - 1 - the plugin or host does support multiple resolutions 00416 * 00417 * Multiple resolution images mean... 00418 * - input and output images can be of any size 00419 * - input and output images can be offset from the origin 00420 */ 00421 #define kOfxImageEffectPropSupportsMultiResolution "OfxImageEffectPropSupportsMultiResolution" 00422 00423 /** @brief Indicates whether a clip, plugin or host supports tiled images 00424 * 00425 * - Type - int X 1 00426 * - Property Set - host descriptor (read only), plugin descriptor (read/write), clip descriptor (read/write) 00427 * - Default - to 1 for a plugin and clip 00428 * - Valid Values - This must be one of 0 or 1 00429 * 00430 * Tiled images mean that input or output images can contain pixel data that is only a subset of their full RoD. 00431 * 00432 * If a clip or plugin does not support tiled images, then the host should supply full RoD images to the effect whenever it fetches one. 00433 */ 00434 #define kOfxImageEffectPropSupportsTiles "OfxImageEffectPropSupportsTiles" 00435 00436 /** @brief Indicates whether an effect is performing an analysis pass. 00437 * 00438 * - Type - int X 1 00439 * - Property Set - plugin instance (read/write) 00440 * - Default - to 0 00441 * - Valid Values - This must be one of 0 or 1 00442 * 00443 * This feature is likely to be deprecated in future releases. 00444 */ 00445 #define kOfxImageEffectPropInAnalysis "OfxImageEffectPropInAnalysis" 00446 00447 /** @brief Indicates support for random temporal access to images in a clip. 00448 * 00449 * - Type - int X 1 00450 * - Property Set - host descriptor (read only), plugin descriptor (read/write), clip descriptor (read/write) 00451 * - Default - to 0 for a plugin and clip 00452 * - Valid Values - This must be one of 0 or 1 00453 * 00454 * On a host, it indicates whether the host supports temporal access to images. 00455 * 00456 * On a plugin, indicates if the plugin needs temporal access to images. 00457 * 00458 * On a clip, it indicates that the clip needs temporal access to images. 00459 */ 00460 #define kOfxImageEffectPropTemporalClipAccess "OfxImageEffectPropTemporalClipAccess" 00461 00462 /** @brief Indicates the context a plugin instance has been created for. 00463 * 00464 * - Type - string X 1 00465 * - Property Set - image effect instance (read only) 00466 * - Valid Values - This must be one of 00467 * - ::kOfxImageEffectContextGenerator 00468 * - ::kOfxImageEffectContextFilter 00469 * - ::kOfxImageEffectContextTransition 00470 * - ::kOfxImageEffectContextPaint 00471 * - ::kOfxImageEffectContextGeneral 00472 * - ::kOfxImageEffectContextRetimer 00473 * 00474 */ 00475 #define kOfxImageEffectPropContext "OfxImageEffectPropContext" 00476 00477 /** @brief Indicates the type of each component in a clip or image (after any mapping) 00478 * 00479 * - Type - string X 1 00480 * - Property Set - clip instance (read only), image instance (read only) 00481 * - Valid Values - This must be one of 00482 * - kOfxBitDepthNone (implying a clip is unconnected, not valid for an image) 00483 * - kOfxBitDepthByte 00484 * - kOfxBitDepthShort 00485 * - kOfxBitDepthFloat 00486 * 00487 * Note that for a clip, this is the value set by the clip preferences action, not the raw 'actual' value of the clip. 00488 */ 00489 #define kOfxImageEffectPropPixelDepth "OfxImageEffectPropPixelDepth" 00490 00491 /** @brief Indicates the current component type in a clip or image (after any mapping) 00492 * 00493 * - Type - string X 1 00494 * - Property Set - clip instance (read only), image instance (read only) 00495 * - Valid Values - This must be one of 00496 * - kOfxImageComponentNone (implying a clip is unconnected, not valid for an image) 00497 * - kOfxImageComponentRGBA 00498 * - kOfxImageComponentRGB 00499 * - kOfxImageComponentAlpha 00500 * 00501 * Note that for a clip, this is the value set by the clip preferences action, not the raw 'actual' value of the clip. 00502 */ 00503 #define kOfxImageEffectPropComponents "OfxImageEffectPropComponents" 00504 00505 /** @brief Uniquely labels an image 00506 * 00507 * - Type - ASCII string X 1 00508 * - Property Set - image instance (read only) 00509 * 00510 * This is host set and allows a plug-in to differentiate between images. This is especially 00511 * useful if a plugin caches analysed information about the image (for example motion vectors). The plugin can label the 00512 * cached information with this identifier. If a user connects a different clip to the analysed input, or the image has changed in some way 00513 * then the plugin can detect this via an identifier change and re-evaluate the cached information. 00514 */ 00515 #define kOfxImagePropUniqueIdentifier "OfxImagePropUniqueIdentifier" 00516 00517 /** @brief Clip and action argument property which indicates that the clip can be sampled continously 00518 * 00519 * - Type - int X 1 00520 * - Property Set - clip instance (read only), as an out argument to ::kOfxImageEffectActionGetClipPreferences action (read/write) 00521 * - Default - 0 as an out argument to the ::kOfxImageEffectActionGetClipPreferences action 00522 * - Valid Values - This must be one of... 00523 * - 0 if the images can only be sampled at discreet times (eg: the clip is a sequence of frames), 00524 * - 1 if the images can only be sampled continuously (eg: the clip is infact an animating roto spline and can be rendered anywhen). 00525 * 00526 * If this is set to true, then the frame rate of a clip is effectively infinite, so to stop arithmetic 00527 * errors the frame rate should then be set to 0. 00528 */ 00529 #define kOfxImageClipPropContinuousSamples "OfxImageClipPropContinuousSamples" 00530 00531 /** @brief Indicates the type of each component in a clip before any mapping by clip preferences 00532 * 00533 * - Type - string X 1 00534 * - Property Set - clip instance (read only) 00535 * - Valid Values - This must be one of 00536 * - kOfxBitDepthNone (implying a clip is unconnected image) 00537 * - kOfxBitDepthByte 00538 * - kOfxBitDepthShort 00539 * - kOfxBitDepthFloat 00540 * 00541 * This is the actual value of the component depth, before any mapping by clip preferences. 00542 */ 00543 #define kOfxImageClipPropUnmappedPixelDepth "OfxImageClipPropUnmappedPixelDepth" 00544 00545 /** @brief Indicates the current 'raw' component type on a clip before any mapping by clip preferences 00546 * 00547 * - Type - string X 1 00548 * - Property Set - clip instance (read only), 00549 * - Valid Values - This must be one of 00550 * - kOfxImageComponentNone (implying a clip is unconnected) 00551 * - kOfxImageComponentRGBA 00552 * - kOfxImageComponentRGB 00553 * - kOfxImageComponentAlpha 00554 */ 00555 #define kOfxImageClipPropUnmappedComponents "OfxImageClipPropUnmappedComponents" 00556 00557 /** @brief Indicates the premultiplication state of a clip or image 00558 * 00559 * - Type - string X 1 00560 * - Property Set - clip instance (read only), image instance (read only), out args property in the ::kOfxImageEffectActionGetClipPreferences action (read/write) 00561 * - Valid Values - This must be one of 00562 * - kOfxImageOpaque - the image is opaque and so has no premultiplication state 00563 * - kOfxImagePreMultiplied - the image is premultiplied by its alpha 00564 * - kOfxImageUnPreMultiplied - the image is unpremultiplied 00565 * 00566 * See the documentation on clip preferences for more details on how this is used with the ::kOfxImageEffectActionGetClipPreferences action. 00567 */ 00568 #define kOfxImageEffectPropPreMultiplication "OfxImageEffectPropPreMultiplication" 00569 00570 /** Used to flag the alpha of an image as opaque */ 00571 #define kOfxImageOpaque "OfxImageOpaque" 00572 00573 /** Used to flag an image as premultiplied */ 00574 #define kOfxImagePreMultiplied "OfxImageAlphaPremultiplied" 00575 00576 /** Used to flag an image as unpremultiplied */ 00577 #define kOfxImageUnPreMultiplied "OfxImageAlphaUnPremultiplied" 00578 00579 00580 /** @brief Indicates the bit depths support by a plug-in or host 00581 * 00582 * - Type - string X N 00583 * - Property Set - host descriptor (read only), plugin descriptor (read/write) 00584 * - Default - plugin descriptor none set 00585 * - Valid Values - This must be one of 00586 * - kOfxBitDepthNone (implying a clip is unconnected, not valid for an image) 00587 * - kOfxBitDepthByte 00588 * - kOfxBitDepthShort 00589 * - kOfxBitDepthFloat 00590 * 00591 * The default for a plugin is to have none set, the plugin \em must define at least one in its describe action. 00592 */ 00593 #define kOfxImageEffectPropSupportedPixelDepths "OfxImageEffectPropSupportedPixelDepths" 00594 00595 00596 /** @brief Indicates the components supported by a clip or host, 00597 * 00598 * - Type - string X N 00599 * - Property Set - host descriptor (read only), clip descriptor (read/write) 00600 * - Valid Values - This must be one of 00601 * - kOfxImageComponentNone (implying a clip is unconnected) 00602 * - kOfxImageComponentRGBA 00603 * - kOfxImageComponentRGB 00604 * - kOfxImageComponentAlpha 00605 * 00606 * This list of strings indicate what component types are supported by a host or are expected as input to a clip. 00607 * 00608 * The default for a clip descriptor is to have none set, the plugin \em must define at least one in its define function 00609 */ 00610 #define kOfxImageEffectPropSupportedComponents "OfxImageEffectPropSupportedComponents" 00611 00612 /** @brief Indicates if a clip is optional. 00613 * 00614 * - Type - int X 1 00615 * - Property Set - clip descriptor (read/write) 00616 * - Default - 0 00617 * - Valid Values - This must be one of 0 or 1 00618 * 00619 */ 00620 #define kOfxImageClipPropOptional "OfxImageClipPropOptional" 00621 00622 /** @brief Indicates that a clip is intended to be used as a mask input 00623 * 00624 * - Type - int X 1 00625 * - Property Set - clip descriptor (read/write) 00626 * - Default - 0 00627 * - Valid Values - This must be one of 0 or 1 00628 * 00629 * Set this property on any clip which will only ever have single channel alpha images fetched from it. Typically on an optional clip such as a junk matte in a keyer. 00630 * 00631 * This property acts as a hint to hosts indicating that they could feed the effect from a rotoshape (or similar) rather than an 'ordinary' clip. 00632 */ 00633 #define kOfxImageClipPropIsMask "OfxImageClipPropIsMask" 00634 00635 00636 /** @brief The pixel aspect ratio of a clip or image. 00637 * 00638 * - Type - double X 1 00639 * - Property Set - clip instance (read only), image instance (read only) and ::kOfxImageEffectActionGetClipPreferences action out args property (read/write) 00640 * 00641 */ 00642 #define kOfxImagePropPixelAspectRatio "OfxImagePropPixelAspectRatio" 00643 00644 /** @brief The frame rate of a clip or instance's project. 00645 * 00646 * - Type - double X 1 00647 * - Property Set - clip instance (read only), effect instance (read only) and ::kOfxImageEffectActionGetClipPreferences action out args property (read/write) 00648 * 00649 * For an input clip this is the frame rate of the clip. 00650 * 00651 * For an output clip, the frame rate mapped via pixel preferences. 00652 * 00653 * For an instance, this is the frame rate of the project the effect is in. 00654 * 00655 * For the outargs property in the ::kOfxImageEffectActionGetClipPreferences action, it is used to change the frame rate of the ouput clip. 00656 */ 00657 #define kOfxImageEffectPropFrameRate "OfxImageEffectPropFrameRate" 00658 00659 /** @brief Indicates the original unmapped frame rate (frames/second) of a clip 00660 * 00661 * - Type - double X 1 00662 * - Property Set - clip instance (read only), 00663 * 00664 * If a plugin changes the output frame rate in the pixel preferences action, this property allows a plugin to get to the original value. 00665 */ 00666 #define kOfxImageEffectPropUnmappedFrameRate "OfxImageEffectPropUnmappedFrameRate" 00667 00668 /** @brief The frame step used for a sequence of renders 00669 * 00670 * - Type - double X 1 00671 * - Property Set - an in argument for the ::kOfxImageEffectActionBeginSequenceRender action (read only) 00672 * - Valid Values - can be any positive value, but typically 00673 * - 1 for frame based material 00674 * - 0.5 for field based material 00675 */ 00676 #define kOfxImageEffectPropFrameStep "OfxImageEffectPropFrameStep" 00677 00678 /** @brief The frame range over which a clip has images. 00679 * 00680 * - Type - double X 2 00681 * - Property Set - clip instance (read only) 00682 * 00683 * Dimension 0 is the first frame for which the clip can produce valid data. 00684 * 00685 * Dimension 1 is the last frame for which the clip can produce valid data. 00686 */ 00687 #define kOfxImageEffectPropFrameRange "OfxImageEffectPropFrameRange" 00688 00689 00690 /** @brief The unmaped frame range over which an output clip has images. 00691 * 00692 * - Type - double X 2 00693 * - Property Set - clip instance (read only) 00694 * 00695 * Dimension 0 is the first frame for which the clip can produce valid data. 00696 * 00697 * Dimension 1 is the last frame for which the clip can produce valid data. 00698 * 00699 * If a plugin changes the output frame rate in the pixel preferences action, it will affect the frame range 00700 * of the output clip, this property allows a plugin to get to the original value. 00701 */ 00702 #define kOfxImageEffectPropUnmappedFrameRange "OfxImageEffectPropUnmappedFrameRange" 00703 00704 /** @brief Says whether the clip is actually connected at the moment. 00705 * 00706 * - Type - int X 1 00707 * - Property Set - clip instance (read only) 00708 * - Valid Values - This must be one of 0 or 1 00709 * 00710 * An instance may have a clip may not be connected to an object that can produce image data. Use this to find out. 00711 * 00712 * Any clip that is not optional will \em always be connected during a render action. However, during interface actions, even non optional clips may be unconnected. 00713 */ 00714 #define kOfxImageClipPropConnected "OfxImageClipPropConnected" 00715 00716 /** @brief Indicates whether an effect will generate different images from frame to frame. 00717 * 00718 * - Type - int X 1 00719 * - Property Set - out argument to ::kOfxImageEffectActionGetClipPreferences action (read/write). 00720 * - Default - 0 00721 * - Valid Values - This must be one of 0 or 1 00722 * 00723 * This property indicates whether a plugin will generate a different image from frame to frame, even if no parameters 00724 * or input image changes. For example a generater that creates random noise pixel at each frame. 00725 */ 00726 #define kOfxImageEffectFrameVarying "OfxImageEffectFrameVarying" 00727 00728 /** @brief The proxy render scale currently being applied. 00729 * 00730 * - Type - double X 2 00731 * - Property Set - an image instance (read only) and as read only an in argument on the following actions, 00732 * - ::kOfxImageEffectActionRender 00733 * - ::kOfxImageEffectActionBeginSequenceRender 00734 * - ::kOfxImageEffectActionEndSequenceRender 00735 * - ::kOfxImageEffectActionIsIdentity 00736 * - ::kOfxImageEffectActionGetRegionOfDefinition 00737 * - ::kOfxImageEffectActionGetRegionsOfInterest 00738 * 00739 * This should be applied to any spatial parameters to position them correctly. Not that the 'x' value does not include any pixel aspect ratios. 00740 */ 00741 #define kOfxImageEffectPropRenderScale "OfxImageEffectPropRenderScale" 00742 00743 /** @brief The extent of the current project in canonical coordinates. 00744 * 00745 * - Type - double X 2 00746 * - Property Set - a plugin instance (read only) 00747 * 00748 * The extent is the size of the 'output' for the current project. See \ref NormalisedCoordinateSystem for more infomation on the project extent. 00749 * 00750 * The extent is in canonical coordinates and only returns the top right position, as the extent is always rooted at 0,0. 00751 * 00752 * For example a PAL SD project would have an extent of 768, 576. 00753 */ 00754 #define kOfxImageEffectPropProjectExtent "OfxImageEffectPropProjectExtent" 00755 00756 /** @brief The size of the current project in canonical coordinates. 00757 * 00758 * - Type - double X 2 00759 * - Property Set - a plugin instance (read only) 00760 * 00761 * The size of a project is a sub set of the ::kOfxImageEffectPropProjectExtent. For example a project may be a PAL SD project, but only be a letter-box within that. The project size is the size of this sub window. 00762 * 00763 * The project size is in canonical coordinates. 00764 * 00765 * See \ref NormalisedCoordinateSystem for more infomation on the project extent. 00766 */ 00767 #define kOfxImageEffectPropProjectSize "OfxImageEffectPropProjectSize" 00768 00769 /** @brief The offset of the current project in canonical coordinates. 00770 * 00771 * - Type - double X 2 00772 * - Property Set - a plugin instance (read only) 00773 * 00774 * The offset is related to the ::kOfxImageEffectPropProjectSize and is the offset from the origin of the project 'subwindow'. 00775 * 00776 * For example for a PAL SD project that is in letterbox form, the project offset is the offset to the bottom left hand corner of the letter box. 00777 * 00778 * The project offset is in canonical coordinates. 00779 * 00780 * See \ref NormalisedCoordinateSystem for more infomation on the project extent. 00781 */ 00782 #define kOfxImageEffectPropProjectOffset "OfxImageEffectPropProjectOffset" 00783 00784 /** @brief The pixel aspect ratio of the current project 00785 * 00786 * - Type - double X 1 00787 * - Property Set - a plugin instance (read only) 00788 * 00789 */ 00790 #define kOfxImageEffectPropProjectPixelAspectRatio "OfxImageEffectPropPixelAspectRatio" 00791 00792 /** @brief The duration of the effect 00793 * 00794 * - Type - double X 1 00795 * - Property Set - a plugin instance (read only) 00796 * 00797 * This contains the duration of the plug-in effect, in frames. 00798 */ 00799 #define kOfxImageEffectInstancePropEffectDuration "OfxImageEffectInstancePropEffectDuration" 00800 00801 /** @brief Which spatial field occurs temporally first in a frame. 00802 * 00803 * - Type - string X 1 00804 * - Property Set - a clip instance (read only) 00805 * - Valid Values - This must be one of 00806 * - ::kOfxImageFieldNone - the material is unfielded 00807 * - ::kOfxImageFieldLower - the material is fielded, with image rows 0,2,4.... occuring first in a frame 00808 * - ::kOfxImageFieldUpper - the material is fielded, with image rows line 1,3,5.... occuring first in a frame 00809 */ 00810 #define kOfxImageClipPropFieldOrder "OfxImageClipPropFieldOrder" 00811 00812 /** @brief The pixel data pointer of an image. 00813 * 00814 * - Type - pointer X 1 00815 * - Property Set - an image instance (read only) 00816 * 00817 * This property contains a pointer to memory that is the lower left hand corner of an image. 00818 */ 00819 #define kOfxImagePropData "OfxImagePropData" 00820 00821 /** @brief The bounds of an image's pixels. 00822 * 00823 * - Type - integer X 4 00824 * - Property Set - an image instance (read only) 00825 * 00826 * The bounds, in \ref PixelCoordinates, are of the addressable pixels in an image's data pointer. 00827 * 00828 * The order of the values is x1, y1, x2, y2. 00829 * 00830 * X values are x1 <= X < x2 00831 * Y values are y1 <= Y < y2 00832 * 00833 * For less than full frame images, the pixel bounds will be contained by the ::kOfxImagePropRegionOfDefinition bounds. 00834 */ 00835 #define kOfxImagePropBounds "OfxImagePropBounds" 00836 00837 /** @brief The full region of definition of an image. 00838 * 00839 * - Type - integer X 4 00840 * - Property Set - an image instance (read only) 00841 * 00842 * An image's region of definition, in \ref PixelCoordinates, is the full frame area of the image plane that the image covers. 00843 * 00844 * The order of the values is x1, y1, x2, y2. 00845 * 00846 * X values are x1 <= X < x2 00847 * Y values are y1 <= Y < y2 00848 * 00849 * The ::kOfxImagePropBounds property contains the actuall addressable pixels in an image, which may be less than its full region of definition. 00850 * 00851 * @remark tuttle: all other Rod are double, why use intergers here? 00852 */ 00853 #define kOfxImagePropRegionOfDefinition "OfxImagePropRegionOfDefinition" 00854 00855 /** @brief The number of bytes in a row of an image. 00856 * 00857 * - Type - integer X 1 00858 * - Property Set - an image instance (read only) 00859 * 00860 * For various alignment reasons, a row of pixels may need to be padded at the end with several bytes before the next row starts in memory. 00861 * 00862 * This property indicates the number of bytes in a row of pixels. This will be at least sizeof(PIXEL) * (bounds.x2-bounds.x1). Where bounds 00863 * is fetched from the ::kOfxImagePropBounds property. 00864 * 00865 * Note that row bytes can be negative, which allows hosts with a native top down row order to pass image into OFX without having to repack pixels. 00866 */ 00867 #define kOfxImagePropRowBytes "OfxImagePropRowBytes" 00868 00869 00870 /** @brief Which fields are present in the image 00871 * 00872 * - Type - string X 1 00873 * - Property Set - an image instance (read only) 00874 * - Valid Values - This must be one of 00875 * - ::kOfxImageFieldNone - the image is an unfielded frame 00876 * - ::kOfxImageFieldBoth - the image is fielded and contains both interlaced fields 00877 * - ::kOfxImageFieldLower - the image is fielded and contains a single field, being the lower field (rows 0,2,4...) 00878 * - ::kOfxImageFieldUpper - the image is fielded and contains a single field, being the upper field (rows 1,3,5...) 00879 * 00880 */ 00881 #define kOfxImagePropField "OfxImagePropField" 00882 00883 /** @brief Controls how a plugin renders fielded footage. 00884 * 00885 * - Type - integer X 1 00886 * - Property Set - a plugin descriptor (read/write) 00887 * - Default - 1 00888 * - Valid Values - This must be one of 00889 * - 0 - the plugin is to have its render function called twice, only if there is animation in any of its parameters 00890 * - 1 - the plugin is to have its render function called twice always 00891 */ 00892 #define kOfxImageEffectPluginPropFieldRenderTwiceAlways "OfxImageEffectPluginPropFieldRenderTwiceAlways" 00893 00894 /** @brief Controls how a plugin fetched fielded imagery from a clip. 00895 * 00896 * - Type - string X 1 00897 * - Property Set - a clip descriptor (read/write) 00898 * - Default - kOfxImageFieldDoubled 00899 * - Valid Values - This must be one of 00900 * - kOfxImageFieldBoth - fetch a full frame interlaced image 00901 * - kOfxImageFieldSingle - fetch a single field, making a half height image 00902 * - kOfxImageFieldDoubled - fetch a single field, but doubling each line and so making a full height image 00903 * 00904 * This controls how a plug-in wishes to fetch images from a fielded clip, so it can tune it behaviour when it renders fielded footage. 00905 * 00906 * Note that if it fetches kOfxImageFieldSingle and the host stores images natively as both fields interlaced, it can return a single image by doubling rowbytes and tweaking the starting address of the image data. This saves on a buffer copy. 00907 */ 00908 #define kOfxImageClipPropFieldExtraction "OfxImageClipPropFieldExtraction" 00909 00910 /** @brief Indicates which field is being rendered. 00911 * 00912 * - Type - string X 1 00913 * - Property Set - a read only in argument property to ::kOfxImageEffectActionRender and ::kOfxImageEffectActionIsIdentity 00914 * - Valid Values - this must be one of 00915 * - kOfxImageFieldNone - there are no fields to deal with, all images are full frame 00916 * - kOfxImageFieldBoth - the imagery is fielded and both scan lines should be renderred 00917 * - kOfxImageFieldLower - the lower field is being rendered (lines 0,2,4...) 00918 * - kOfxImageFieldUpper - the upper field is being rendered (lines 1,3,5...) 00919 */ 00920 #define kOfxImageEffectPropFieldToRender "OfxImageEffectPropFieldToRender" 00921 00922 /** @brief Used to indicate the region of definition of a plug-in 00923 * 00924 * - Type - double X 4 00925 * - Property Set - a read/write out argument property to the ::kOfxImageEffectActionGetRegionOfDefinition action 00926 * - Default - see ::kOfxImageEffectActionGetRegionOfDefinition 00927 * 00928 * The order of the values is x1, y1, x2, y2. 00929 * 00930 * This will be in \ref CanonicalCoordinates 00931 */ 00932 #define kOfxImageEffectPropRegionOfDefinition "OfxImageEffectPropRegionOfDefinition" 00933 00934 /** @brief The value of a region of interest. 00935 * 00936 * - Type - double X 4 00937 * - Property Set - a read only in argument property to the ::kOfxImageEffectActionGetRegionsOfInterest action 00938 * 00939 * A host passes this value into the region of interest action to specify the region it is interested in rendering. 00940 * 00941 * The order of the values is x1, y1, x2, y2. 00942 * 00943 * This will be in \ref CanonicalCoordinates. 00944 */ 00945 #define kOfxImageEffectPropRegionOfInterest "OfxImageEffectPropRegionOfInterest" 00946 00947 /** @brief The region to be rendered. 00948 * 00949 * - Type - integer X 4 00950 * - Property Set - a read only in argument property to the ::kOfxImageEffectActionRender and ::kOfxImageEffectActionIsIdentity actions 00951 * 00952 * The order of the values is x1, y1, x2, y2. 00953 * 00954 * This will be in \ref PixelCoordinates 00955 * 00956 */ 00957 #define kOfxImageEffectPropRenderWindow "OfxImageEffectPropRenderWindow" 00958 00959 00960 /** String used to label imagery as having no fields */ 00961 #define kOfxImageFieldNone "OfxFieldNone" 00962 /** String used to label the lower field (scan lines 0,2,4...) of fielded imagery */ 00963 #define kOfxImageFieldLower "OfxFieldLower" 00964 /** String used to label the upper field (scan lines 1,3,5...) of fielded imagery */ 00965 #define kOfxImageFieldUpper "OfxFieldUpper" 00966 /** String used to label both fields of fielded imagery, indicating interlaced footage */ 00967 #define kOfxImageFieldBoth "OfxFieldBoth" 00968 /** String used to label an image that consists of a single field, and so is half height */ 00969 #define kOfxImageFieldSingle "OfxFieldSingle" 00970 /** String used to label an image that consists of a single field, but each scan line is double, 00971 * and so is full height */ 00972 #define kOfxImageFieldDoubled "OfxFieldDoubled" 00973 00974 /*@}*/ 00975 /*@}*/ 00976 00977 /** @brief String that is the name of the standard OFX output clip */ 00978 #define kOfxImageEffectOutputClipName kOfxOutputAttributeName 00979 00980 /** @brief String that is the name of the standard OFX single source input clip */ 00981 #define kOfxImageEffectSimpleSourceClipName kOfxSimpleSourceAttributeName 00982 00983 /** @brief String that is the name of the 'from' clip in the OFX transition context */ 00984 #define kOfxImageEffectTransitionSourceFromClipName "SourceFrom" 00985 00986 /** @brief String that is the name of the 'from' clip in the OFX transition context */ 00987 #define kOfxImageEffectTransitionSourceToClipName "SourceTo" 00988 00989 /** @brief the name of the mandated 'Transition' param for the transition context */ 00990 #define kOfxImageEffectTransitionParamName "Transition" 00991 00992 /** @brief the name of the mandated 'SourceTime' param for the retime context */ 00993 #define kOfxImageEffectRetimerParamName "SourceTime" 00994 00995 00996 00997 00998 /** @brief the string that names image effect suites, passed to OfxHost::fetchSuite */ 00999 #define kOfxImageEffectSuite "OfxImageEffectSuite" 01000 01001 /** @brief The OFX suite for image effects 01002 * 01003 * This suite provides the functions needed by a plugin to defined and use an image effect plugin. 01004 */ 01005 typedef struct OfxImageEffectSuiteV1 01006 { 01007 /** @brief Retrieves the property set for the given image effect 01008 * 01009 * \arg imageEffect image effect to get the property set for 01010 * \arg propHandle pointer to a the property set pointer, value is returned here 01011 * 01012 * The property handle is for the duration of the image effect handle. 01013 * 01014 * @returns 01015 * - ::kOfxStatOK - the property set was found and returned 01016 * - ::kOfxStatErrBadHandle - if the paramter handle was invalid 01017 * - ::kOfxStatErrUnknown - if the type is unknown 01018 */ 01019 OfxStatus ( *getPropertySet )( OfxImageEffectHandle imageEffect, 01020 OfxPropertySetHandle* propHandle ); 01021 01022 /** @brief Retrieves the parameter set for the given image effect 01023 * 01024 * \arg imageEffect image effect to get the property set for 01025 * \arg paramSet pointer to a the parameter set, value is returned here 01026 * 01027 * The param set handle is valid for the lifetime of the image effect handle. 01028 * 01029 * @returns 01030 * - ::kOfxStatOK - the property set was found and returned 01031 * - ::kOfxStatErrBadHandle - if the paramter handle was invalid 01032 * - ::kOfxStatErrUnknown - if the type is unknown 01033 */ 01034 OfxStatus ( *getParamSet )( OfxImageEffectHandle imageEffect, 01035 OfxParamSetHandle* paramSet ); 01036 01037 01038 /** @brief Define a clip to the effect. 01039 * 01040 * \arg pluginHandle - the handle passed into 'describeInContext' action 01041 * \arg name - unique name of the clip to define 01042 * \arg propertySet - a property handle for the clip descriptor will be returned here 01043 * 01044 * This function defines a clip to a host, the returned property set is used to describe 01045 * various aspects of the clip to the host. Note that this does not create a clip instance. 01046 * 01047 * \pre 01048 * - we are inside the describe in context action. 01049 * 01050 * @returns 01051 */ 01052 OfxStatus ( *clipDefine )( OfxImageEffectHandle imageEffect, 01053 const char* name, 01054 OfxPropertySetHandle* propertySet ); 01055 01056 /** @brief Get the propery handle of the named input clip in the given instance 01057 * 01058 * \arg imageEffect - an instance handle to the plugin 01059 * \arg name - name of the clip, previously used in a clip define call 01060 * \arg clip - where to return the clip 01061 * \arg propertySet if not null, the descriptor handle for a parameter's property set will be placed here. 01062 * 01063 * The propertySet will have the same value as would be returned by OfxImageEffectSuiteV1::clipGetPropertySet 01064 * 01065 * This return a clip handle for the given instance, note that this will \em not be the same as the 01066 * clip handle returned by clipDefine and will be distanct to clip handles in any other instance 01067 * of the plugin. 01068 * 01069 * Not a valid call in any of the describe actions. 01070 * 01071 * \pre 01072 * - create instance action called, 01073 * - \e name passed to clipDefine for this context, 01074 * - not inside describe or describe in context actions. 01075 * 01076 * \post 01077 * - handle will be valid for the life time of the instance. 01078 * 01079 */ 01080 OfxStatus ( *clipGetHandle )( OfxImageEffectHandle imageEffect, 01081 const char* name, 01082 OfxImageClipHandle* clip, 01083 OfxPropertySetHandle* propertySet ); 01084 01085 /** @brief Retrieves the property set for a given clip 01086 * 01087 * \arg clip clip effect to get the property set for 01088 * \arg propHandle pointer to a the property set handle, value is returedn her 01089 * 01090 * The property handle is valid for the lifetime of the clip, which is generally the lifetime of the instance. 01091 * 01092 * @returns 01093 * - ::kOfxStatOK - the property set was found and returned 01094 * - ::kOfxStatErrBadHandle - if the paramter handle was invalid 01095 * - ::kOfxStatErrUnknown - if the type is unknown 01096 */ 01097 OfxStatus ( *clipGetPropertySet )( OfxImageClipHandle clip, 01098 OfxPropertySetHandle* propHandle ); 01099 01100 /** @brief Get a handle for an image in a clip at the indicated time and indicated region 01101 * 01102 * \arg clip - the clip to extract the image from 01103 * \arg time - time to fetch the image at 01104 * \arg region - region to fetch the image from (optional, set to NULL to get a 'default' region) 01105 * this is in the \ref CanonicalCoordinates. 01106 * \arg imageHandle - property set containing the image's data 01107 * 01108 * An image is fetched from a clip at the indicated time for the given region and returned in the imageHandle. 01109 * 01110 * If the \e region parameter is not set to NULL, then it will be clipped to the clip's Region of Definition for the given time. The returned image will be \em at \em least as big as this region. If the region parameter is not set, then the region fetched will be at least the Region of Interest the effect has previously specified, clipped the clip's Region of Definition. 01111 * 01112 * If clipGetImage is called twice with the same parameters, then two separate image handles will be returned, each of which must be release. The underlying implementation could share image data pointers and use reference counting to maintain them. 01113 * 01114 * \pre 01115 * - clip was returned by clipGetHandle 01116 * 01117 * \post 01118 * - image handle is only valid for the duration of the action clipGetImage is called in 01119 * - image handle to be disposed of by clipReleaseImage before the action returns 01120 * 01121 * @returns 01122 * - ::kOfxStatOK - the image was successfully fetched and returned in the handle, 01123 * - ::kOfxStatFailed - the image could not be fetched because it does not exist in the clip at the indicated time and/or region, the plugin 01124 * should continue operation, but assume the image was black and transparent. 01125 * - ::kOfxStatErrBadHandle - the clip handle was invalid, 01126 * - ::kOfxStatErrMemory - the host had not enough memory to complete the operation, plugin should abort whatever it was doing. 01127 * 01128 */ 01129 OfxStatus ( *clipGetImage )( OfxImageClipHandle clip, 01130 OfxTime time, 01131 OfxRectD* region, 01132 OfxPropertySetHandle* imageHandle ); 01133 01134 /** @brief Releases the image handle previously returned by clipGetImage 01135 * 01136 * 01137 * \pre 01138 * - imageHandle was returned by clipGetImage 01139 * 01140 * \post 01141 * - all operations on imageHandle will be invalid 01142 * 01143 * @returns 01144 * - ::kOfxStatOK - the image was successfully fetched and returned in the handle, /// @todo tuttle: ofx documentation error, succesfully deleted, delete the propertySet himself or not ? 01145 * - ::kOfxStatErrBadHandle - the image handle was invalid, 01146 */ 01147 OfxStatus ( *clipReleaseImage )( OfxPropertySetHandle imageHandle ); 01148 01149 01150 /** @brief Returns the spatial region of definition of the clip at the given time 01151 * 01152 * \arg clipHandle - the clip to extract the image from 01153 * \arg time - time to fetch the image at 01154 * \arg region - region to fetch the image from (optional, set to NULL to get a 'default' region) 01155 * this is in the \ref CanonicalCoordinates. 01156 * \arg imageHandle - handle where the image is returned 01157 * 01158 * An image is fetched from a clip at the indicated time for the given region and returned in the imageHandle. 01159 * 01160 * If the \e region parameter is not set to NULL, then it will be clipped to the clip's Region of Definition for the given time. The returned image will be \em at \em least as big as this region. If the region parameter is not set, then the region fetched will be at least the Region of Interest the effect has previously specified, clipped the clip's Region of Definition. 01161 * 01162 * \pre 01163 * - clipHandle was returned by clipGetHandle 01164 * 01165 * \post 01166 * - bounds will be filled the RoD of the clip at the indicated time 01167 * 01168 * @returns 01169 * - ::kOfxStatOK - the image was successfully fetched and returned in the handle, 01170 * - ::kOfxStatFailed - the image could not be fetched because it does not exist in the clip at the indicated time, the plugin 01171 * should continue operation, but assume the image was black and transparent. 01172 * - ::kOfxStatErrBadHandle - the clip handle was invalid, 01173 * - ::kOfxStatErrMemory - the host had not enough memory to complete the operation, plugin should abort whatever it was doing. 01174 * 01175 * 01176 */ 01177 OfxStatus ( *clipGetRegionOfDefinition )( OfxImageClipHandle clip, 01178 OfxTime time, 01179 OfxRectD* bounds ); 01180 01181 /** @brief Returns whether to abort processing or not. 01182 * 01183 * \arg imageEffect - instance of the image effect 01184 * 01185 * A host may want to signal to a plugin that it should stop whatever rendering it is doing and start again. 01186 * Generally this is done in interactive threads in response to users tweaking some parameter. 01187 * 01188 * This function indicates whether a plugin should stop whatever processing it is doing. 01189 * 01190 * @returns 01191 * - 0 if the effect should continue whatever processing it is doing 01192 * - 1 if the effect should abort whatever processing it is doing 01193 */ 01194 int ( *abort )( OfxImageEffectHandle imageEffect ); 01195 01196 /** @brief Allocate memory from the host's image memory pool 01197 * 01198 * \arg instanceHandle - effect instance to associate with this memory allocation, may be NULL. 01199 * \arg nBytes - the number of bytes to allocate 01200 * \arg memoryHandle - pointer to the memory handle where a return value is placed 01201 * 01202 * Memory handles allocated by this should be freed by OfxImageEffectSuiteV1::imageMemoryFree. 01203 * To access the memory behind the handle you need to call OfxImageEffectSuiteV1::imageMemoryLock. 01204 * 01205 * See \ref ImageEffectsMemoryAllocation. 01206 * 01207 * @returns 01208 * - kOfxStatOK if all went well, a valid memory handle is placed in \e memoryHandle 01209 * - kOfxStatErrBadHandle if instanceHandle is not valid, memoryHandle is set to NULL 01210 * - kOfxStatErrMemory if there was not enough memory to satisfy the call, memoryHandle is set to NULL 01211 */ 01212 OfxStatus ( *imageMemoryAlloc )( OfxImageEffectHandle instanceHandle, 01213 size_t nBytes, 01214 OfxImageMemoryHandle* memoryHandle ); 01215 01216 /** @brief Frees a memory handle and associated memory. 01217 * 01218 * \arg memoryHandle - memory handle returned by imageMemoryAlloc 01219 * 01220 * This function frees a memory handle and associated memory that was previously allocated via OfxImageEffectSuiteV1::imageMemoryAlloc 01221 * 01222 * If there are outstanding locks, these are ignored and the handle and memory are freed anyway. 01223 * 01224 * See \ref ImageEffectsMemoryAllocation. 01225 * 01226 * @returns 01227 * - kOfxStatOK if the memory was cleanly deleted 01228 * - kOfxStatErrBadHandle if the value of \e memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc 01229 */ 01230 OfxStatus ( *imageMemoryFree )( OfxImageMemoryHandle memoryHandle ); 01231 01232 /** @brief Lock the memory associated with a memory handle and make it available for use. 01233 * 01234 * \arg memoryHandle - memory handle returned by imageMemoryAlloc 01235 * \arg returnedPtr - where to the pointer to the locked memory 01236 * 01237 * This function locks them memory associated with a memory handle and returns a pointer to it. The memory will be 16 byte aligned, to allow use of vector operations. 01238 * 01239 * Note that memory locks and unlocks nest. 01240 * 01241 * After the first lock call, the contents of the memory pointer to by \e returnedPtr is undefined. All subsequent calls to lock will return memory with the same contents as the previous call. 01242 * 01243 * Also, if unlocked, then relocked, the memory associated with a memory handle may be at a different address. 01244 * 01245 * See also OfxImageEffectSuiteV1::imageMemoryUnlock and \ref ImageEffectsMemoryAllocation. 01246 * 01247 * @returns 01248 * - kOfxStatOK if the memory was locked, a pointer is placed in \e returnedPtr 01249 * - kOfxStatErrBadHandle if the value of \e memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc, null is placed in \e *returnedPtr 01250 * - kOfxStatErrMemory if there was not enough memory to satisfy the call, \e *returnedPtr is set to NULL 01251 */ 01252 OfxStatus ( *imageMemoryLock )( OfxImageMemoryHandle memoryHandle, 01253 void** returnedPtr ); 01254 01255 /** @brief Unlock allocated image data 01256 * 01257 * \arg allocatedData - pointer to memory previously returned by OfxImageEffectSuiteV1::imageAlloc 01258 * 01259 * This function unlocks a previously locked memory handle. Once completely unlocked, memory associated with a memoryHandle is no longer available for use. Attempting to use it results in undefined behaviour. 01260 * 01261 * Note that locks and unlocks nest, and to fully unlock memory you need to match the count of locks placed upon it. 01262 * 01263 * Also note, if you unlock a completely unlocked handle, it has no effect (ie: the lock count can't be negative). 01264 * 01265 * If unlocked, then relocked, the memory associated with a memory handle may be at a different address, however the contents will remain the same. 01266 * 01267 * See also OfxImageEffectSuiteV1::imageMemoryLock and \ref ImageEffectsMemoryAllocation. 01268 * 01269 * @returns 01270 * - kOfxStatOK if the memory was unlocked cleanly, 01271 * - kOfxStatErrBadHandle if the value of \e memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc, null is placed in \e *returnedPtr 01272 */ 01273 OfxStatus ( *imageMemoryUnlock )( OfxImageMemoryHandle memoryHandle ); 01274 01275 } OfxImageEffectSuiteV1; 01276 01277 01278 01279 /** 01280 * \addtogroup StatusCodes 01281 */ 01282 /*@{*/ 01283 /** 01284 * \defgroup StatusCodesImageEffect Image Effect API Status Codes 01285 * 01286 * These are status codes returned by functions in the OfxImageEffectSuite and Image Effect plugin functions. 01287 * 01288 * They range from 1000 until 1999 01289 */ 01290 /*@{*/ 01291 /** @brief Error code for incorrect image formats */ 01292 #define kOfxStatErrImageFormat ( (int) 1000 ) 01293 01294 01295 /*@}*/ 01296 /*@}*/ 01297 01298 #ifdef __cplusplus 01299 } 01300 #endif 01301 01302 01303 #endif 01304