-
Notifications
You must be signed in to change notification settings - Fork 6
/
ofxCore.h
984 lines (734 loc) · 37.8 KB
/
ofxCore.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
#ifndef _ofxCore_h_
#define _ofxCore_h_
/*
Software License :
Copyright (c) 2003-2015, The Open Effects Association Ltd. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name The Open Effects Association Ltd, nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "stddef.h" // for size_t
#include <limits.h> // for INT_MIN & INT_MAX
#ifdef __cplusplus
extern "C" {
#endif
/** @file ofxCore.h
Contains the core OFX architectural struct and function definitions. For more details on the basic OFX architecture, see \ref Architecture.
*/
/** @brief Platform independent export macro.
*
* This macro is to be used before any symbol that is to be
* exported from a plug-in. This is OS/compiler dependent.
*/
#if defined(WIN32) || defined(WIN64)
#define OfxExport extern __declspec(dllexport)
#else
#define OfxExport extern
#endif
/** @brief Blind data structure to manipulate sets of properties through */
typedef struct OfxPropertySetStruct *OfxPropertySetHandle;
/** @brief OFX status return type */
typedef int OfxStatus;
/** @brief Generic host structure passed to OfxPlugin::setHost function
This structure contains what is needed by a plug-in to bootstrap its connection
to the host.
*/
typedef struct OfxHost {
/** @brief Global handle to the host. Extract relevant host properties from this.
This pointer will be valid while the binary containing the plug-in is loaded.
*/
OfxPropertySetHandle host;
/** @brief The function which the plug-in uses to fetch suites from the host.
\arg \e host - the host the suite is being fetched from this \em must be the \e host member of the OfxHost struct containing fetchSuite.
\arg \e suiteName - ASCII string labelling the host supplied API
\arg \e suiteVersion - version of that suite to fetch
Any API fetched will be valid while the binary containing the plug-in is loaded.
Repeated calls to fetchSuite with the same parameters will return the same pointer.
returns
- NULL if the API is unknown (either the api or the version requested),
- pointer to the relevant API if it was found
*/
const void *(*fetchSuite)(OfxPropertySetHandle host, const char *suiteName, int suiteVersion);
} OfxHost;
/** @brief Entry point for plug-ins
\arg \e action - ASCII c string indicating which action to take
\arg \e instance - object to which action should be applied, this will need to be cast to the appropriate blind data type depending on the \e action
\arg \e inData - handle that contains action specific properties
\arg \e outData - handle where the plug-in should set various action specific properties
This is how the host generally communicates with a plug-in. Entry points are used to pass messages
to various objects used within OFX. The main use is within the OfxPlugin struct.
The exact set of actions is determined by the plug-in API that is being implemented, however all plug-ins
can perform several actions. For the list of actions consult \ref ActionsAll.
*/
typedef OfxStatus (OfxPluginEntryPoint)(const char *action, const void *handle, OfxPropertySetHandle inArgs, OfxPropertySetHandle outArgs);
/** @brief The structure that defines a plug-in to a host.
*
* This structure is the first element in any plug-in structure
* using the OFX plug-in architecture. By examining its members
* a host can determine the API that the plug-in implements,
* the version of that API, its name and version.
*
* For details see \ref Architecture.
*
*/
typedef struct OfxPlugin {
/** Defines the type of the plug-in, this will tell the host what the plug-in does. e.g.: an image
effects plug-in would be a "OfxImageEffectPlugin"
*/
const char *pluginApi;
/** Defines the version of the pluginApi that this plug-in implements */
int apiVersion;
/** String that uniquely labels the plug-in among all plug-ins that implement an API.
It need not necessarily be human sensible, however the preference is to use reverse
internet domain name of the developer, followed by a '.' then by a name that represents
the plug-in.. It must be a legal ASCII string and have no whitespace in the
name and no non printing chars.
For example "uk.co.somesoftwarehouse.myPlugin"
*/
const char *pluginIdentifier;
/** Major version of this plug-in, this gets incremented when backwards compatibility is broken. */
unsigned int pluginVersionMajor;
/** Major version of this plug-in, this gets incremented when software is changed,
but does not break backwards compatibility. */
unsigned int pluginVersionMinor;
/** @brief Function the host uses to connect the plug-in to the host's api fetcher
\arg \e fetchApi - pointer to host's API fetcher
Mandatory function.
The very first function called in a plug-in. The plug-in \em must \em not call any OFX functions within this, it must only set its local copy of the host pointer.
\pre
- nothing else has been called
\post
- the pointer suite is valid until the plug-in is unloaded
*/
void (*setHost)(OfxHost *host);
/** @brief Main entry point for plug-ins
Mandatory function.
The exact set of actions is determined by the plug-in API that is being implemented, however all plug-ins
can perform several actions. For the list of actions consult \ref ActionsAll.
Preconditions
- setHost has been called
*/
OfxPluginEntryPoint *mainEntry;
} OfxPlugin;
/**
\defgroup ActionsAll OFX Actions
These are the actions passed to a plug-in's 'main' function
*/
/*@{*/
/** @brief
This action is the first action passed to a plug-in after the
binary containing the plug-in has been loaded. It is there to allow a
plug-in to create any global data structures it may need and is also
when the plug-in should fetch suites from the host.
The \ref handle, \ref inArgs and \ref outArgs arguments to the \ref mainEntry
are redundant and should be set to NULL.
\pre
- The plugin's \ref OfxPlugin::setHost function has been called
\post
This action will not be called again while the binary containing the plug-in remains loaded.
@returns
- \ref kOfxStatOK, the action was trapped and all was well,
- \ref kOfxStatReplyDefault, the action was ignored,
- \ref kOfxStatFailed, the load action failed, no further actions will be passed to the plug-in.
Interpret if possible kOfxStatFailed as plug-in indicating it does not want to load
Do not create an entry in the host's UI for plug-in then.
Plug-in also has the option to return 0 for OfxGetNumberOfPlugins or kOfxStatFailed if host supports OfxSetHost in which case kOfxActionLoad will never be called.
- \ref kOfxStatErrFatal, fatal error in the plug-in.
*/
#define kOfxActionLoad "OfxActionLoad"
/** @brief
The kOfxActionDescribe is the second action passed to a plug-in. It is
where a plugin defines how it behaves and the resources it needs to
function.
Note that the handle passed in acts as a descriptor for, rather than an
instance of the plugin. The handle is global and unique. The plug-in is
at liberty to cache the handle away for future reference until the
plug-in is unloaded.
Most importantly, the effect must set what image effect contexts it is
capable of working in.
This action *must* be trapped, it is not optional.
@param handle handle to the plug-in descriptor, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is set to NULL
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionLoad has been called
\post
- \ref kOfxActionDescribe will not be called again, unless it fails and
returns one of the error codes where the host is allowed to attempt
the action again
- the handle argument, being the global plug-in description handle, is
a valid handle from the end of a sucessful describe action until the
end of the \ref kOfxActionUnload action (ie: the plug-in can cache it away
without worrying about it changing between actions).
- \ref kOfxImageEffectActionDescribeInContext
will be called once for each context that the host and plug-in
mutually support. If a plug-in does not report to support any context supported by host,
host should not enable the plug-in.
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatErrMissingHostFeature, in which the plugin will be unloaded
and ignored, plugin may post message
- \ref kOfxStatErrMemory, in which case describe may be called again after a
memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate,
plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxActionDescribe "OfxActionDescribe"
/** @brief
This action is the last action passed to the plug-in before the
binary containing the plug-in is unloaded. It is there to allow a
plug-in to destroy any global data structures it may have created.
The handle, inArgs and outArgs arguments to the main entry
are redundant and should be set to NULL.
\pref
- the \ref kOfxActionLoad action has been called
- all instances of a plugin have been destroyed
\post
- No other actions will be called.
@returns
- \ref kOfxStatOK, the action was trapped all was well
- \ref kOfxStatReplyDefault, the action was ignored
- \ref kOfxStatErrFatal, in which case we the program will be forced to quit
*/
#define kOfxActionUnload "OfxActionUnload"
/** @brief
This action is an action that may be passed to a plug-in
instance from time to time in low memory situations. Instances recieving
this action should destroy any data structures they may have and release
the associated memory, they can later reconstruct this from the effect's
parameter set and associated information.
For Image Effects, it is generally a bad idea to call this after each
render, but rather it should be called after
\ref kOfxImageEffectActionEndSequenceRender
Some effects, typically those flagged with the
\ref kOfxImageEffectInstancePropSequentialRender
property, may need to cache information from previously rendered frames
to function correctly, or have data structures that are expensive to
reconstruct at each frame (eg: a particle system). Ideally, such effect
should free such structures during the
\ref kOfxImageEffectActionEndSequenceRender action.
@param handle handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is set to NULL
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionCreateInstance has been called on the instance handle,
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatReplyDefault, the action was ignored
- \ref kOfxStatErrFatal,
- \ref kOfxStatFailed, something went wrong, but no error code appropriate,
the plugin should to post a message
*/
#define kOfxActionPurgeCaches "OfxActionPurgeCaches"
/** @brief
This action is called when a plugin should synchronise any private data
structures to its parameter set. This generally occurs when an effect is
about to be saved or copied, but it could occur in other situations as
well.
@param handle handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is set to NULL
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionCreateInstance has been called on the instance handle,
\post
- Any private state data can be reconstructed from the parameter set,
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatReplyDefault, the action was ignored
- \ref kOfxStatErrFatal,
- \ref kOfxStatFailed, something went wrong, but no error code appropriate,
the plugin should to post a message
*/
#define kOfxActionSyncPrivateData "OfxActionSyncPrivateData"
/** @brief
This action is the first action passed to a plug-in's
instance after its creation. It is there to allow a plugin to create any
per-instance data structures it may need.
@param handle handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is set to NULL
@param outArgs is redundant and is set to NULL
\pref
- \ref kOfxActionDescribe has been called
- the instance is fully constructed, with all objects requested in the
describe actions (eg, parameters and clips) have been constructed and
have had their initial values set. This means that if the values are
being loaded from an old setup, that load should have taken place
before the create instance action is called.
\post
- the instance pointer will be valid until the
\ref kOfxActionDestroyInstance
action is passed to the plug-in with the same instance handle
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatReplyDefault, the action was ignored, but all was well anyway
- \ref kOfxStatErrFatal
- \ref kOfxStatErrMemory, in which case this may be called again after a
memory purge
- \ref kOfxStatFailed, something went wrong, but no error code appropriate,
the plugin should to post a message if possible and the host should
destroy the instanace handle and not attempt to proceed further
*/
#define kOfxActionCreateInstance "OfxActionCreateInstance"
/** @brief
This action is the last passed to a plug-in's instance before its
destruction. It is there to allow a plugin to destroy any per-instance
data structures it may have created.
@param handle
handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is set to NULL
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionCreateInstance
has been called on the handle,
- the instance has not had any of its members destroyed yet,
\post
- the instance pointer is no longer valid and any operation on it will
be undefined
@returns
To some extent, what is returned is moot, a bit like throwing an
exception in a C++ destructor, so the host should continue destruction
of the instance regardless.
- \ref kOfxStatOK, the action was trapped and all was well,
- \ref kOfxStatReplyDefault, the action was ignored as the effect had nothing
to do,
- \ref kOfxStatErrFatal,
- \ref kOfxStatFailed, something went wrong, but no error code appropriate,
the plugin should to post a message.
*/
#define kOfxActionDestroyInstance "OfxActionDestroyInstance"
/** @brief
This action signals that something has changed in a plugin's instance,
either by user action, the host or the plugin itself. All change actions
are bracketed by a pair of \ref kOfxActionBeginInstanceChanged and
\ref kOfxActionEndInstanceChanged actions. The ``inArgs`` property set is
used to determine what was the thing inside the instance that was
changed.
@param handle handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following properties
- \ref kOfxPropType The type of the thing that changed which will be one of..
- \ref kOfxTypeParameter Indicating a parameter's value has changed
in some way
- \ref kOfxTypeClip A clip to an image effect has changed in some
way (for Image Effect Plugins only)
- \ref kOfxPropName the name of the thing that was changed in the instance
- \ref kOfxPropChangeReason what triggered the change, which will be one of...
- \ref kOfxChangeUserEdited - the user or host changed the instance
somehow and caused a change to something, this includes
undo/redos, resets and loading values from files or presets,
- \ref kOfxChangePluginEdited - the plugin itself has changed the
value of the instance in some action
- \ref kOfxChangeTime - the time has changed and this has affected the
value of the object because it varies over time
- \ref kOfxPropTime
- the effect time at which the chang occured (for Image Effect Plugins only)
- \ref kOfxImageEffectPropRenderScale
- the render scale currently being applied to any image fetched
from a clip (for Image Effect Plugins only)
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionCreateInstance has been called on the instance handle,
- \ref kOfxActionBeginInstanceChanged has been called on the instance
handle.
\post
- \ref kOfxActionEndInstanceChanged will be called on the instance handle.
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatReplyDefault, the action was ignored
- \ref kOfxStatErrFatal,
- \ref kOfxStatFailed, something went wrong, but no error code appropriate,
the plugin should to post a message
*/
#define kOfxActionInstanceChanged "OfxActionInstanceChanged"
/** @brief
The \ref kOfxActionBeginInstanceChanged and \ref kOfxActionEndInstanceChanged actions
are used to bracket all \ref kOfxActionInstanceChanged actions, whether a
single change or multiple changes. Some changes to a plugin instance can
be grouped logically (eg: a 'reset all' button resetting all the
instance's parameters), the begin/end instance changed actions allow a
plugin to respond appropriately to a large set of changes. For example,
a plugin that maintains a complex internal state can delay any changes
to that state until all parameter changes have completed.
@param handle
handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following properties
- \ref kOfxPropChangeReason what triggered the change, which will be one of...
- \ref kOfxChangeUserEdited - the user or host changed the instance
somehow and caused a change to something, this includes
undo/redos, resets and loading values from files or presets,
- \ref kOfxChangePluginEdited - the plugin itself has changed the
value of the instance in some action
- \ref kOfxChangeTime - the time has changed and this has affected the
value of the object because it varies over time
@param outArgs is redundant and is set to NULL
\post
- For \ref kOfxActionBeginInstanceChanged , \ref kOfxActionCreateInstance has been called on the instance handle.
- For \ref kOfxActionEndInstanceChanged , \ref kOfxActionBeginInstanceChanged has been called on the instance handle.
- \ref kOfxActionCreateInstance has been called on the instance handle.
\post
- For \ref kOfxActionBeginInstanceChanged, \ref kOfxActionInstanceChanged will be called at least once on the instance handle.
- \ref kOfxActionEndInstanceChanged will be called on the instance handle.
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatReplyDefault, the action was ignored
- \ref kOfxStatErrFatal,
- \ref kOfxStatFailed, something went wrong, but no error code appropriate,
the plugin should to post a message
*/
#define kOfxActionBeginInstanceChanged "OfxActionBeginInstanceChanged"
/** @brief Action called after the end of a set of \ref kOfxActionEndInstanceChanged actions, used with ::kOfxActionBeginInstanceChanged to bracket a grouped set of changes, see \ref kOfxActionBeginInstanceChanged*/
#define kOfxActionEndInstanceChanged "OfxActionEndInstanceChanged"
/** @brief
This is called when an instance is *first* actively edited by a user,
ie: and interface is open and parameter values and input clips can be
modified. It is there so that effects can create private user interface
structures when necassary. Note that some hosts can have multiple
editors open on the same effect instance simulateously.
@param handle handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is set to NULL
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionCreateInstance has been called on the instance handle,
\post
- \ref kOfxActionEndInstanceEdit will be called when the last editor is
closed on the instance
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatReplyDefault, the action was ignored
- \ref kOfxStatErrFatal,
- \ref kOfxStatFailed, something went wrong, but no error code appropriate,
the plugin should to post a message
*/
#define kOfxActionBeginInstanceEdit "OfxActionBeginInstanceEdit"
/** @brief
This is called when the *last* user interface on an instance closed. It
is there so that effects can destroy private user interface structures
when necassary. Note that some hosts can have multiple editors open on
the same effect instance simulateously, this will only be called when
the last of those editors are closed.
@param handle handle to the plug-in instance, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is set to NULL
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionBeginInstanceEdit has been called on the instance handle,
\post
- no user interface is open on the instance
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatReplyDefault, the action was ignored
- \ref kOfxStatErrFatal,
- \ref kOfxStatFailed, something went wrong, but no error code appropriate,
the plugin should to post a message
*/
#define kOfxActionEndInstanceEdit "OfxActionEndInstanceEdit"
/*@}*/
/** @brief Returns the 'nth' plug-in implemented inside a binary
*
* Returns a pointer to the 'nth' plug-in implemented in the binary. A function of this type
* must be implemented in and exported from each plug-in binary.
*/
OfxExport OfxPlugin *OfxGetPlugin(int nth);
/** @brief Defines the number of plug-ins implemented inside a binary
*
* A host calls this to determine how many plug-ins there are inside
* a binary it has loaded. A function of this type
* must be implemented in and exported from each plug-in binary.
*/
OfxExport int OfxGetNumberOfPlugins(void);
/** @brief First thing host should call
*
* This host call, added in 2020, is not specified in earlier implementation of the API.
* Therefore host must check if the plugin implemented it and not assume symbol exists.
* The order of calls is then: 1) OfxSetHost, 2) OfxGetNumberOfPlugins, 3) OfxGetPlugin
* The host pointer is only assumed valid until OfxGetPlugin where it might get reset.
* Plug-in can return kOfxStatFailed to indicate it has nothing to do here, it's not for this Host and it should be skipped silently.
*/
OfxExport OfxStatus OfxSetHost(const OfxHost *host);
/**
\defgroup PropertiesAll Ofx Properties
These strings are used to identify properties within OFX, they are broken up by the host suite or API they relate to.
*/
/*@{*/
/**
\defgroup PropertiesGeneral General Properties
These properties are general properties and apply to may objects across OFX
*/
/*@{*/
/** @brief Property on the host descriptor, saying what API version of the API is being implemented
- Type - int X N
- Property Set - host descriptor.
This is a version string that will specify which version of the API is being implemented by a host. It
can have multiple values. For example "1.0", "1.2.4" etc.....
If this is not present, it is safe to assume that the version of the API is "1.0".
*/
#define kOfxPropAPIVersion "OfxPropAPIVersion"
/** @brief General property used to get/set the time of something.
- Type - double X 1
- Default - 0, if a setable property
- Property Set - commonly used as an argument to actions, input and output.
*/
#define kOfxPropTime "OfxPropTime"
/** @brief Indicates if a host is actively editing the effect with some GUI.
- Type - int X 1
- Property Set - effect instance (read only)
- Valid Values - 0 or 1
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.
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 interace. 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 if the flag.
*/
#define kOfxPropIsInteractive "OfxPropIsInteractive"
/** @brief The file path to the plugin.
- Type - C string X 1
- Property Set - effect descriptor (read only)
This is a string that indicates the file path where the plug-in was found by the host. The path is in the native
path format for the host OS (eg: UNIX directory separators are forward slashes, Windows ones are backslashes).
The path is to the bundle location, see \ref InstallationLocation.
eg: '/usr/OFX/Plugins/AcmePlugins/AcmeFantasticPlugin.ofx.bundle'
*/
#define kOfxPluginPropFilePath "OfxPluginPropFilePath"
/** @brief A private data pointer that the plug-in can store its own data behind.
- Type - pointer X 1
- Property Set - plugin instance (read/write),
- Default - NULL
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.
*/
#define kOfxPropInstanceData "OfxPropInstanceData"
/** @brief General property, used to identify the kind of an object behind a handle
- Type - ASCII C string X 1
- Property Set - any object handle (read only)
- Valid Values - currently this can be...
- ::kOfxTypeImageEffectHost
- ::kOfxTypeImageEffect
- ::kOfxTypeImageEffectInstance
- ::kOfxTypeParameter
- ::kOfxTypeParameterInstance
- ::kOfxTypeClip
- ::kOfxTypeImage
*/
#define kOfxPropType "OfxPropType"
/** @brief Unique name of an object.
- Type - ASCII C string X 1
- Property Set - on many objects (descriptors and instances), see \ref PropertiesByObject (read only)
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.
*/
#define kOfxPropName "OfxPropName"
/** @brief Identifies a specific version of a host or plugin.
- Type - int X N
- Property Set - host descriptor (read only), plugin descriptor (read/write)
- Default - "0"
- Valid Values - positive integers
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.
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).
*/
#define kOfxPropVersion "OfxPropVersion"
/** @brief Unique user readable version string of a plugin or host.
- Type - string X 1
- Property Set - host descriptor (read only), plugin descriptor (read/write)
- Default - none, the host needs to set this
- Valid Values - ASCII string
This is purely for user feedback, a plugin or host should use ::kOfxPropVersion if they need
to check for specific versions.
*/
#define kOfxPropVersionLabel "OfxPropVersionLabel"
/** @brief Description of the plug-in to a user.
- Type - string X 1
- Property Set - plugin descriptor (read/write) and instance (read only)
- Default - ""
- Valid Values - UTF8 string
This is a string giving a potentially verbose description of the effect.
*/
#define kOfxPropPluginDescription "OfxPropPluginDescription"
/** @brief User visible name of an object.
- Type - UTF8 C string X 1
- Property Set - on many objects (descriptors and instances), see \ref PropertiesByObject. Typically readable and writable in most cases.
- Default - the ::kOfxPropName the object was created with.
The label is what a user sees on any interface in place of the object's name.
Note that resetting this will also reset ::kOfxPropShortLabel and ::kOfxPropLongLabel.
*/
#define kOfxPropLabel "OfxPropLabel"
/** @brief If set this tells the host to use an icon instead of a label for some object in the interface.
- Type - string X 2
- Property Set - various descriptors in the API
- Default - ""
- Valid Values - ASCII string
The value is a path is defined relative to the Resource folder that points to an SVG or PNG file containing the icon.
The first dimension, if set, will the name of and SVG file, the second a PNG file.
*/
#define kOfxPropIcon "OfxPropIcon"
/** @brief Short user visible name of an object.
- Type - UTF8 C string X 1
- Property Set - on many objects (descriptors and instances), see \ref PropertiesByObject. Typically readable and writable in most cases.
- Default - initially ::kOfxPropName, but will be reset if ::kOfxPropLabel is changed.
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.
*/
#define kOfxPropShortLabel "OfxPropShortLabel"
/** @brief Long user visible name of an object.
- Type - UTF8 C string X 1
- Property Set - on many objects (descriptors and instances), see \ref PropertiesByObject. Typically readable and writable in most cases.
- Default - initially ::kOfxPropName, but will be reset if ::kOfxPropLabel is changed.
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.
*/
#define kOfxPropLongLabel "OfxPropLongLabel"
/** @brief Indicates why a plug-in changed.
- Type - ASCII C string X 1
- Property Set - inArgs parameter on the ::kOfxActionInstanceChanged action.
- Valid Values - this can be...
- ::kOfxChangeUserEdited - the user directly edited the instance somehow and caused a change to something, this includes undo/redos and resets
- ::kOfxChangePluginEdited - the plug-in itself has changed the value of the object in some action
- ::kOfxChangeTime - the time has changed and this has affected the value of the object because it varies over time
Argument property for the ::kOfxActionInstanceChanged action.
*/
#define kOfxPropChangeReason "OfxPropChangeReason"
/** @brief A pointer to an effect instance.
- Type - pointer X 1
- Property Set - on an interact instance (read only)
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,
the interact instance will have one of these so that the plug-in can connect back to the effect the GUI links to.
*/
#define kOfxPropEffectInstance "OfxPropEffectInstance"
/** @brief A pointer to an operating system specific application handle.
- Type - pointer X 1
- Property Set - host descriptor.
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.
*/
#define kOfxPropHostOSHandle "OfxPropHostOSHandle"
/*@}*/
/*@}*/
/** @brief String used as a value to ::kOfxPropChangeReason to indicate a user has changed something */
#define kOfxChangeUserEdited "OfxChangeUserEdited"
/** @brief String used as a value to ::kOfxPropChangeReason to indicate the plug-in itself has changed something */
#define kOfxChangePluginEdited "OfxChangePluginEdited"
/** @brief String used as a value to ::kOfxPropChangeReason to a time varying object has changed due to a time change */
#define kOfxChangeTime "OfxChangeTime"
/** @brief How time is specified within the OFX API */
typedef double OfxTime;
/** @brief Defines one dimensional integer bounds */
typedef struct OfxRangeI {
int min, max;
} OfxRangeI;
/** @brief Defines one dimensional double bounds */
typedef struct OfxRangeD {
double min, max;
} OfxRangeD;
/** @brief Defines two dimensional integer point */
typedef struct OfxPointI {
int x, y;
} OfxPointI;
/** @brief Defines two dimensional double point */
typedef struct OfxPointD {
double x, y;
} OfxPointD;
/** @brief Used to flag infinite rects. Set minimums to this to indicate infinite
This is effectively INT_MAX.
*/
#define kOfxFlagInfiniteMax INT_MAX
/** @brief Used to flag infinite rects. Set minimums to this to indicate infinite.
This is effectively INT_MIN
*/
#define kOfxFlagInfiniteMin INT_MIN
/** @brief Defines two dimensional integer region
Regions are x1 <= x < x2
Infinite regions are flagged by setting
- x1 = \ref kOfxFlagInfiniteMin
- y1 = \ref kOfxFlagInfiniteMin
- x2 = \ref kOfxFlagInfiniteMax
- y2 = \ref kOfxFlagInfiniteMax
*/
typedef struct OfxRectI {
int x1, y1, x2, y2;
} OfxRectI;
/** @brief Defines two dimensional double region
Regions are x1 <= x < x2
Infinite regions are flagged by setting
- x1 = \ref kOfxFlagInfiniteMin
- y1 = \ref kOfxFlagInfiniteMin
- x2 = \ref kOfxFlagInfiniteMax
- y2 = \ref kOfxFlagInfiniteMax
*/
typedef struct OfxRectD {
double x1, y1, x2, y2;
} OfxRectD;
/** @brief String used to label unset bitdepths */
#define kOfxBitDepthNone "OfxBitDepthNone"
/** @brief String used to label unsigned 8 bit integer samples */
#define kOfxBitDepthByte "OfxBitDepthByte"
/** @brief String used to label unsigned 16 bit integer samples */
#define kOfxBitDepthShort "OfxBitDepthShort"
/** @brief String used to label half-float (16 bit floating point) samples
* \version Added in Version 1.4. Was in ofxOpenGLRender.h before.
*/
#define kOfxBitDepthHalf "OfxBitDepthHalf"
/** @brief String used to label signed 32 bit floating point samples */
#define kOfxBitDepthFloat "OfxBitDepthFloat"
/**
\defgroup StatusCodes Status Codes
These strings are used to identify error states within ofx, they are returned
by various host suite functions, as well as plug-in functions. The valid return codes
for each function are documented with that function.
*/
/*@{*/
/**
\defgroup StatusCodesGeneral General Status Codes
General status codes start at 1 and continue until 999
*/
/*@{*/
/** @brief Status code indicating all was fine */
#define kOfxStatOK 0
/** @brief Status error code for a failed operation. */
#define kOfxStatFailed ((int)1)
/** @brief Status error code for a fatal error
Only returned in the case where the plug-in or host cannot continue to function and needs to be restarted.
*/
#define kOfxStatErrFatal ((int)2)
/** @brief Status error code for an operation on or request for an unknown object */
#define kOfxStatErrUnknown ((int)3)
/** @brief Status error code returned by plug-ins when they are missing host functionality, either an API or some optional functionality (eg: custom params).
Plug-Ins returning this should post an appropriate error message stating what they are missing.
*/
#define kOfxStatErrMissingHostFeature ((int) 4)
/** @brief Status error code for an unsupported feature/operation */
#define kOfxStatErrUnsupported ((int) 5)
/** @brief Status error code for an operation attempting to create something that exists */
#define kOfxStatErrExists ((int) 6)
/** @brief Status error code for an incorrect format */
#define kOfxStatErrFormat ((int) 7)
/** @brief Status error code indicating that something failed due to memory shortage */
#define kOfxStatErrMemory ((int) 8)
/** @brief Status error code for an operation on a bad handle */
#define kOfxStatErrBadHandle ((int) 9)
/** @brief Status error code indicating that a given index was invalid or unavailable */
#define kOfxStatErrBadIndex ((int)10)
/** @brief Status error code indicating that something failed due an illegal value */
#define kOfxStatErrValue ((int) 11)
/** @brief OfxStatus returned indicating a 'yes' */
#define kOfxStatReplyYes ((int) 12)
/** @brief OfxStatus returned indicating a 'no' */
#define kOfxStatReplyNo ((int) 13)
/** @brief OfxStatus returned indicating that a default action should be performed */
#define kOfxStatReplyDefault ((int) 14)
/*@}*/
/*@}*/
#ifdef __cplusplus
}
#endif
/** @mainpage OFX : Open Plug-Ins For Special Effects
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.
A more complete reference manual is http://openfx.sourceforge.net .
*/
#endif