forked from AcademySoftwareFoundation/openfx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathofxImageEffect.h
More file actions
1735 lines (1274 loc) · 76.6 KB
/
Copy pathofxImageEffect.h
File metadata and controls
1735 lines (1274 loc) · 76.6 KB
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
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#ifndef _ofxImageEffect_h_
#define _ofxImageEffect_h_
// Copyright OpenFX and contributors to the OpenFX project.
// SPDX-License-Identifier: BSD-3-Clause
#include "ofxCore.h"
#include "ofxParam.h"
#include "ofxInteract.h"
#include "ofxMessage.h"
#include "ofxMemory.h"
#include "ofxMultiThread.h"
#include "ofxInteract.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @brief String used to label OFX Image Effect Plug-ins
Set the pluginApi member of the OfxPluginHeader inside any OfxImageEffectPluginStruct
to be this so that the host knows the plugin is an image effect.
*/
#define kOfxImageEffectPluginApi "OfxImageEffectPluginAPI"
/** @brief The current version of the Image Effect API
*/
#define kOfxImageEffectPluginApiVersion 1
/** @brief Blind declaration of an OFX image effect
*/
typedef struct OfxImageEffectStruct *OfxImageEffectHandle;
/** @brief Blind declaration of an OFX image effect
*/
typedef struct OfxImageClipStruct *OfxImageClipHandle;
/** @brief Blind declaration for an handle to image memory returned by the image memory management routines */
typedef struct OfxImageMemoryStruct *OfxImageMemoryHandle;
/** @brief String to label something with unset components */
#define kOfxImageComponentNone "OfxImageComponentNone"
/** @brief String to label images with RGBA components */
#define kOfxImageComponentRGBA "OfxImageComponentRGBA"
/** @brief String to label images with RGB components */
#define kOfxImageComponentRGB "OfxImageComponentRGB"
/** @brief String to label images with only Alpha components */
#define kOfxImageComponentAlpha "OfxImageComponentAlpha"
/** @brief Use to define the generator image effect context. See \ref ::kOfxImageEffectPropContext
*/
#define kOfxImageEffectContextGenerator "OfxImageEffectContextGenerator"
/** @brief Use to define the filter effect image effect context See \ref ::kOfxImageEffectPropContext */
#define kOfxImageEffectContextFilter "OfxImageEffectContextFilter"
/** @brief Use to define the transition image effect context See \ref ::kOfxImageEffectPropContext */
#define kOfxImageEffectContextTransition "OfxImageEffectContextTransition"
/** @brief Use to define the paint image effect context See \ref ::kOfxImageEffectPropContext */
#define kOfxImageEffectContextPaint "OfxImageEffectContextPaint"
/** @brief Use to define the general image effect context See \ref ::kOfxImageEffectPropContext */
#define kOfxImageEffectContextGeneral "OfxImageEffectContextGeneral"
/** @brief Use to define the retimer effect context See \ref ::kOfxImageEffectPropContext */
#define kOfxImageEffectContextRetimer "OfxImageEffectContextRetimer"
/** @brief Used as a value for ::kOfxPropType on image effect host handles */
#define kOfxTypeImageEffectHost "OfxTypeImageEffectHost"
/** @brief Used as a value for ::kOfxPropType on image effect plugin handles */
#define kOfxTypeImageEffect "OfxTypeImageEffect"
/** @brief Used as a value for ::kOfxPropType on image effect instance handles */
#define kOfxTypeImageEffectInstance "OfxTypeImageEffectInstance"
/** @brief Used as a value for ::kOfxPropType on image effect clips */
#define kOfxTypeClip "OfxTypeClip"
/** @brief Used as a value for ::kOfxPropType on image effect images */
#define kOfxTypeImage "OfxTypeImage"
/**
\addtogroup ActionsAll
*/
/*@{*/
/**
\defgroup ImageEffectActions Image Effect Actions
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.
*/
/*@{*/
/** @brief
The region of definition for an image effect is the rectangular section
of the 2D image plane that it is capable of filling, given the state of
its input clips and parameters. This action is used to calculate the RoD
for a plugin instance at a given frame. For more details on regions of
definition see \ref ImageEffectArchitectures "Image Effect Architectures"
Note that hosts that have constant sized imagery need not call this
action, only hosts that allow image sizes to vary need call this.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following properties
- \ref kOfxPropTime the effect time for which a region of definition is being
requested
- \ref kOfxImageEffectPropRenderScale the render scale that should be used in any calculations in this
action
@param outArgs has the following property which the plug-in may set
- \ref kOfxImageEffectPropRegionOfDefinition the calculated region of definition, initially set by the host
to the default RoD (see below), in Canonical Coordinates.
If the effect did not trap this, it means the host should use the
default RoD instead, which depends on the context. This is...
- generator context - defaults to the project window,
- filter and paint contexts - defaults to the RoD of the 'Source' input
clip at the given time,
- transition context - defaults to the union of the RoDs of the
'SourceFrom' and 'SourceTo' input clips at the given time,
- general context - defaults to the union of the RoDs of all the non
optional input clips and the 'Source' input clip (if it exists and it
is connected) at the given time, if none exist, then it is the
project window
- retimer context - defaults to the union of the RoD of the 'Source'
input clip at the frame directly preceding the value of the
'SourceTime' double parameter and the frame directly after it
@returns
- \ref kOfxStatOK the action was trapped and the RoD was set in the outArgs property set
- \ref kOfxStatReplyDefault, the action was not trapped and the host should use the default values
- \ref kOfxStatErrMemory, in which case the action may be called again after a memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate, plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionGetRegionOfDefinition "OfxImageEffectActionGetRegionOfDefinition"
/** @brief
This action allows a host to ask an effect, given a region I want to
render, what region do you need from each of your input clips. In that
way, depending on the host architecture, a host can fetch the minimal
amount of the image needed as input. Note that there is a region of
interest to be set in ``outArgs`` for each input clip that exists on the
effect. For more details see \ref ImageEffectArchitectures "Image Effect
Architectures"
The default RoI is simply the value passed in on the
\ref kOfxImageEffectPropRegionOfInterest
``inArgs`` property set. All the RoIs in the ``outArgs`` property set
must initialised to this value before the action is called.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following properties
- \ref kOfxPropTime the effect time for which a region of definition is being requested
- \ref kOfxImageEffectPropRenderScale the render scale that should be used in any calculations in this action
- \ref kOfxImageEffectPropRegionOfInterest the region to be rendered in the output image, in Canonical Coordinates.
@param outArgs has a set of 4 dimensional double properties, one for each of the input clips to the effect.
The properties are each named ``OfxImageClipPropRoI_`` with the clip name post pended, for example
``OfxImageClipPropRoI_Source``. These are initialised to the default RoI.
@returns
- \ref kOfxStatOK, the action was trapped and at least one RoI was set in the outArgs property set
- \ref kOfxStatReplyDefault, the action was not trapped and the host should use the default values
- \ref kOfxStatErrMemory, in which case the action may be called again after a memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate, plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionGetRegionsOfInterest "OfxImageEffectActionGetRegionsOfInterest"
/** @brief
This action allows a host to ask an effect what range of frames it can
produce images over. Only effects instantiated in the \ref generalContext "General
Context" can have this called on them. In all other
the host is in strict control over the temporal duration of the effect.
The default is:
- the union of all the frame ranges of the non optional input clips,
- infinite if there are no non optional input clips.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is null
@param outArgs has the following property
- \ref kOfxImageEffectPropFrameRange the frame range an effect can produce images for
\pre
- \ref kOfxActionCreateInstance has been called on the instance
- the effect instance has been created in the general effect context
@returns
- \ref kOfxStatOK, the action was trapped and the \ref kOfxImageEffectPropFrameRange was set in the outArgs property set
- \ref kOfxStatReplyDefault, the action was not trapped and the host should use the default value
- \ref kOfxStatErrMemory, in which case the action may be called again after a memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate, plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionGetTimeDomain "OfxImageEffectActionGetTimeDomain"
/** @brief
This action lets the host ask the effect what frames are needed from
each input clip to process a given frame. For example a temporal based
degrainer may need several frames around the frame to render to do its
work.
This action need only ever be called if the plugin has set the
\ref kOfxImageEffectPropTemporalClipAccess
property on the plugin descriptor to be true. Otherwise the host assumes
that the only frame needed from the inputs is the current one and this
action is not called.
Note that each clip can have it's required frame range specified, and
that you can specify discontinuous sets of ranges for each clip, for
example
\code{.cpp}
// The effect always needs the initial frame of the source as well as the previous and current frame
double rangeSource[4];
// required ranges on the source
rangeSource[0] = 0; // we always need frame 0 of the source
rangeSource[1] = 0;
rangeSource[2] = currentFrame - 1; // we also need the previous and current frame on the source
rangeSource[3] = currentFrame;
gPropHost->propSetDoubleN(outArgs, "OfxImageClipPropFrameRange_Source", 4, rangeSource);
\endcode
Which sets two discontinuous range of frames from the 'Source' clip
required as input.
The default frame range is simply the single frame,
kOfxPropTime..kOfxPropTime, found on the ``inArgs`` property set. All
the frame ranges in the ``outArgs`` property set must initialised to
this value before the action is called.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following property
- \ref kOfxPropTime the effect time for which we need to calculate the frames needed on input
- \ref outArgs has a set of properties, one for each input clip, named
``OfxImageClipPropFrameRange_`` with the name of the clip post-pended.
For example ``OfxImageClipPropFrameRange_Source``. All these properties
are multi-dimensional doubles, with the dimension is a multiple of
two. Each pair of values indicates a continuous range of frames that
is needed on the given input. They are all initalised to the default value.
@returns
- \ref kOfxStatOK, the action was trapped and at least one frame range in the outArgs property set
- \ref kOfxStatReplyDefault, the action was not trapped and the host should use the default values
- \ref kOfxStatErrMemory, in which case the action may be called again after a memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate, plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionGetFramesNeeded "OfxImageEffectActionGetFramesNeeded"
/** @brief
This action allows a plugin to dynamically specify its preferences for
input and output clips. Please see \ref ImageEffectClipPreferences "Image Effect Clip Preferences" for more details on the
behaviour. Clip preferences are constant for the duration of an effect,
so this action need only be called once per clip, not once per frame.
This should be called once after creation of an instance, each time an
input clip is changed, and whenever a parameter named in the
\ref kOfxImageEffectPropClipPreferencesSlaveParam
has its value changed.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs is redundant and is set to NULL
@param outArgs has the following properties which the plugin can set
- a set of char \* X 1 properties, one for each of the input clips
currently attached and the output clip, labelled with
``OfxImageClipPropComponents_`` post pended with the clip's name.
This must be set to one of the component types which the host
supports and the effect stated it can accept on that input
- a set of char \* X 1 properties, one for each of the input clips
currently attached and the output clip, labelled with
``OfxImageClipPropDepth_`` post pended with the clip's name. This
must be set to one of the pixel depths both the host and plugin
supports
- a set of double X 1 properties, one for each of the input clips
currently attached and the output clip, labelled with
``OfxImageClipPropPAR_`` post pended with the clip's name. This is
the pixel aspect ratio of the input and output clips. This must be
set to a positive non zero double value,
- \ref kOfxImageEffectPropFrameRate the frame rate of the output clip, this must be set to a positive non zero double value
- \ref kOfxImageClipPropFieldOrder the fielding of the output clip
- \ref kOfxImageEffectPropPreMultiplication the premultiplication of the output clip
- \ref kOfxImageClipPropContinuousSamples whether the output clip can produce different images at non-frame intervals, defaults to false,
- \ref kOfxImageEffectFrameVarying whether the output clip can produces different images at
different times, even if all parameters and inputs are constant,
defaults to false.
@returns
- \ref kOfxStatOK, the action was trapped and at least one of the properties in the outArgs
was changed from its default value
- \ref kOfxStatReplyDefault, the action was not trapped and the host should
use the default values
- \ref kOfxStatErrMemory, in which case the action may be called again after
a memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate,
plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionGetClipPreferences "OfxImageEffectActionGetClipPreferences"
/** @brief
Sometimes an effect can pass through an input uprocessed, for example a
blur effect with a blur size of 0. This action can be called by a host
before it attempts to render an effect to determine if it can simply
copy input directly to output without having to call the render action
on the effect.
If the effect does not need to process any pixels, it should set the
value of the \ref kOfxPropName to the clip that the host should us as the
output instead, and the \ref kOfxPropTime property on ``outArgs`` to be
the time at which the frame should be fetched from a clip.
The default action is to call the render action on the effect.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following properties
- \ref kOfxPropTime the time at which to test for identity
- \ref kOfxImageEffectPropFieldToRender the field to test for identity
- \ref kOfxImageEffectPropRenderWindow the window (in \\ref PixelCoordinates) to test for identity under
- \ref kOfxImageEffectPropRenderScale the scale factor being applied to the images being renderred
@param outArgs has the following properties which the plugin can set
- \ref kOfxPropName
this to the name of the clip that should be used if the effect is
an identity transform, defaults to the empty string
- \ref kOfxPropTime
the time to use from the indicated source clip as an identity
image (allowing time slips to happen), defaults to the value in
\ref kOfxPropTime in inArgs
@returns
- \ref kOfxStatOK, the action was trapped and the effect should not have its
render action called, the values in outArgs
indicate what frame from which clip to use instead
- \ref kOfxStatReplyDefault, the action was not trapped and the host should
call the render action
- \ref kOfxStatErrMemory, in which case the action may be called again after
a memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate,
plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionIsIdentity "OfxImageEffectActionIsIdentity"
/** @brief
This action is where an effect gets to push pixels and turn its input
clips and parameter set into an output image. This is possibly quite
complicated and covered in the \ref RenderingEffects "Rendering Image Effects" chapter.
The render action *must* be trapped by the plug-in, it cannot return
\ref kOfxStatReplyDefault. The pixels needs be pushed I'm afraid.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following properties
- \ref kOfxPropTime the time at which to render
- \ref kOfxImageEffectPropFieldToRender the field to render
- \ref kOfxImageEffectPropRenderWindow the window (in \\ref PixelCoordinates) to render
- \ref kOfxImageEffectPropRenderScale the scale factor being applied to the images being renderred
- \ref kOfxImageEffectPropSequentialRenderStatus whether the effect is currently being rendered in strict frame order on a single instance
- \ref kOfxImageEffectPropInteractiveRenderStatus if the render is in response to a user modifying the effect in an interactive session
- \ref kOfxImageEffectPropRenderQualityDraft if the render should be done in draft mode (e.g. for faster scrubbing)
@param outArgs is redundant and should be set to NULL
\pre
- \ref kOfxActionCreateInstance has been called on the instance
- \ref kOfxImageEffectActionBeginSequenceRender has been called on the
instance
\post
- \ref kOfxImageEffectActionEndSequenceRender action will be called on the
instance
@returns
- \ref kOfxStatOK, the effect rendered happily
- \ref kOfxStatErrMemory, in which case the action may be called again after
a memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate,
plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionRender "OfxImageEffectActionRender"
/** @brief
This action is passed to an image effect before it renders a range of
frames. It is there to allow an effect to set things up for a long
sequence of frames. Note that this is still called, even if only a
single frame is being rendered in an interactive environment.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following properties
- \ref kOfxImageEffectPropFrameRange the range of frames (inclusive) that will be renderred
- \ref kOfxImageEffectPropFrameStep what is the step between frames, generally set to 1 (for full frame renders) or 0.5 (for fielded renders)
- \ref kOfxPropIsInteractive is this a single frame render due to user interaction in a GUI, or a proper full sequence render.
- \ref kOfxImageEffectPropRenderScale the scale factor to apply to images for this call
- \ref kOfxImageEffectPropSequentialRenderStatus whether the effect is currently being rendered in strict frame order on a single instance
- \ref kOfxImageEffectPropInteractiveRenderStatus if the render is in response to a user modifying the effect in an interactive session
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionCreateInstance has been called on the instance
\post
- \ref kOfxImageEffectActionRender action will be called at least once on the instance
- \ref kOfxImageEffectActionEndSequenceRender action will be called on the
instance
@returns
- \ref kOfxStatOK, the action was trapped and handled cleanly by the effect,
- \ref kOfxStatReplyDefault, the action was not trapped, but all is well
anyway,
- \ref kOfxStatErrMemory, in which case the action may be called again after
a memory purge,
- \ref kOfxStatFailed, something wrong, but no error code appropriate,
plugin to post message,
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionBeginSequenceRender "OfxImageEffectActionBeginSequenceRender"
/** @brief
This action is passed to an image effect after is has rendered a range
of frames. It is there to allow an effect to free resources after a long
sequence of frame renders. Note that this is still called, even if only
a single frame is being rendered in an interactive environment.
@param handle handle to the instance, cast to an \ref OfxImageEffectHandle
@param inArgs has the following properties
- \ref kOfxImageEffectPropFrameRange the range of frames (inclusive) that will be rendered
- \ref kOfxImageEffectPropFrameStep what is the step between frames, generally set to 1 (for full frame renders) or 0.5 (for fielded renders),
- \ref kOfxPropIsInteractive
- \ref is this a single frame render due to user interaction in a GUI, or a proper full sequence render.
- \ref kOfxImageEffectPropRenderScale
- \ref the scale factor to apply to images for this call
- \ref kOfxImageEffectPropSequentialRenderStatus
- \ref whether the effect is currently being rendered in strict frame order on a single instance
- \ref kOfxImageEffectPropInteractiveRenderStatus
- \ref if the render is in response to a user modifying the effect in an interactive session
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionCreateInstance has been called on the instance
- \ref kOfxImageEffectActionEndSequenceRender action was called on the
instance
- \ref kOfxImageEffectActionRender action was called at least once on the
instance
@returns
- \ref kOfxStatOK, the action was trapped and handled cleanly by the effect,
- \ref kOfxStatReplyDefault, the action was not trapped, but all is well
anyway,
- \ref kOfxStatErrMemory, in which case the action may be called again after
a memory purge,
- \ref kOfxStatFailed, something wrong, but no error code appropriate,
plugin to post message,
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionEndSequenceRender "OfxImageEffectActionEndSequenceRender"
/** @brief
This action is unique to OFX Image Effect plug-ins. Because a plugin is
able to exhibit different behaviour depending on the context of use,
each separate context will need to be described individually. It is
within this action that image effects describe which parameters and
input clips it requires.
This action will be called multiple times, one for each of the contexts
the plugin says it is capable of implementing. If a host does not
support a certain context, then it need not call
\ref kOfxImageEffectActionDescribeInContext for that context.
This action *must* be trapped, it is not optional.
@param handle handle to the context descriptor, cast to an \ref OfxImageEffectHandle
this may or may not be the same as passed to \ref kOfxActionDescribe
@param inArgs has the following property:
- \ref kOfxImageEffectPropContext the context being described
@param outArgs is redundant and is set to NULL
\pre
- \ref kOfxActionDescribe has been called on the descriptor handle,
- \ref kOfxActionCreateInstance has not been called
@returns
- \ref kOfxStatOK, the action was trapped and all was well
- \ref kOfxStatErrMissingHostFeature, in which the context will be ignored
by the host, the plugin may post a message
- \ref kOfxStatErrMemory, in which case the action may be called again after
a memory purge
- \ref kOfxStatFailed, something wrong, but no error code appropriate,
plugin to post message
- \ref kOfxStatErrFatal
*/
#define kOfxImageEffectActionDescribeInContext "OfxImageEffectActionDescribeInContext"
/*@}*/
/*@}*/
/**
\addtogroup PropertiesAll
*/
/*@{*/
/**
\defgroup ImageEffectPropDefines Image Effect Property Definitions
These are the list of properties used by the Image Effects API.
*/
/*@{*/
/** @brief Indicates to the host the contexts a plugin can be used in.
- Type - string X N
- Property Set - image effect descriptor passed to kOfxActionDescribe (read/write)
- Default - this has no defaults, it must be set
- Valid Values - This must be one of
- ::kOfxImageEffectContextGenerator
- ::kOfxImageEffectContextFilter
- ::kOfxImageEffectContextTransition
- ::kOfxImageEffectContextPaint
- ::kOfxImageEffectContextGeneral
- ::kOfxImageEffectContextRetimer
*/
#define kOfxImageEffectPropSupportedContexts "OfxImageEffectPropSupportedContexts"
/** @brief The plugin handle passed to the initial 'describe' action.
- Type - pointer X 1
- Property Set - plugin instance, (read only)
This value will be the same for all instances of a plugin.
*/
#define kOfxImageEffectPropPluginHandle "OfxImageEffectPropPluginHandle"
/** @brief Indicates if a host is a background render.
- Type - int X 1
- Property Set - host descriptor (read only)
- Valid Values - This must be one of
- 0 if the host is a foreground host, it may open the effect in an interactive session (or not)
- 1 if the host is a background 'processing only' host, and the effect will never be opened in an interactive session.
*/
#define kOfxImageEffectHostPropIsBackground "OfxImageEffectHostPropIsBackground"
/** @brief Indicates whether only one instance of a plugin can exist at the same time
- Type - int X 1
- Property Set - plugin descriptor (read/write)
- Default - 0
- Valid Values - This must be one of
- 0 - which means multiple instances can exist simultaneously,
- 1 - which means only one instance can exist at any one time.
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.
*/
#define kOfxImageEffectPluginPropSingleInstance "OfxImageEffectPluginPropSingleInstance"
/** @brief Indicates how many simultaneous renders the plugin can deal with.
- Type - string X 1
- Property Set - plugin descriptor (read/write)
- Default - ::kOfxImageEffectRenderInstanceSafe
- Valid Values - This must be one of
- ::kOfxImageEffectRenderUnsafe - indicating that only a single 'render' call can be made at any time amoung all instances,
- ::kOfxImageEffectRenderInstanceSafe - indicating that any instance can have a single 'render' call at any one time,
- ::kOfxImageEffectRenderFullySafe - indicating that any instance of a plugin can have multiple renders running simultaneously
*/
#define kOfxImageEffectPluginRenderThreadSafety "OfxImageEffectPluginRenderThreadSafety"
/** @brief String used to label render threads as un thread safe, see, \ref ::kOfxImageEffectPluginRenderThreadSafety */
#define kOfxImageEffectRenderUnsafe "OfxImageEffectRenderUnsafe"
/** @brief String used to label render threads as instance thread safe, \ref ::kOfxImageEffectPluginRenderThreadSafety */
#define kOfxImageEffectRenderInstanceSafe "OfxImageEffectRenderInstanceSafe"
/** @brief String used to label render threads as fully thread safe, \ref ::kOfxImageEffectPluginRenderThreadSafety */
#define kOfxImageEffectRenderFullySafe "OfxImageEffectRenderFullySafe"
/** @brief Indicates whether a plugin lets the host perform per frame SMP threading
- Type - int X 1
- Property Set - plugin descriptor (read/write)
- Default - 1
- Valid Values - This must be one of
- 0 - which means that the plugin will perform any per frame SMP threading
- 1 - which means the host can call an instance's render function simultaneously at the same frame, but with different windows to render.
*/
#define kOfxImageEffectPluginPropHostFrameThreading "OfxImageEffectPluginPropHostFrameThreading"
/** @brief Indicates whether a host or plugin can support clips of differing component depths going into/out of an effect
- Type - int X 1
- Property Set - plugin descriptor (read/write), host descriptor (read only)
- Default - 0 for a plugin
- Valid Values - This must be one of
- 0 - in which case the host or plugin does not support clips of multiple pixel depths,
- 1 - which means a host or plugin is able to to deal with clips of multiple pixel depths,
If a host indicates that it can support multiple pixels depths, then it will allow the plugin to explicitly set
the output clip's pixel depth in the ::kOfxImageEffectActionGetClipPreferences action. See \ref ImageEffectClipPreferences.
*/
#define kOfxImageEffectPropSupportsMultipleClipDepths "OfxImageEffectPropMultipleClipDepths"
/** @brief Indicates whether a host or plugin can support clips of differing pixel aspect ratios going into/out of an effect
- Type - int X 1
- Property Set - plugin descriptor (read/write), host descriptor (read only)
- Default - 0 for a plugin
- Valid Values - This must be one of
- 0 - in which case the host or plugin does not support clips of multiple pixel aspect ratios
- 1 - which means a host or plugin is able to to deal with clips of multiple pixel aspect ratios
If a host indicates that it can support multiple pixel aspect ratios, then it will allow the plugin to explicitly set
the output clip's aspect ratio in the ::kOfxImageEffectActionGetClipPreferences action. See \ref ImageEffectClipPreferences.
*/
#define kOfxImageEffectPropSupportsMultipleClipPARs "OfxImageEffectPropSupportsMultipleClipPARs"
/** @brief Indicates the set of parameters on which a value change will trigger a change to clip preferences
- Type - string X N
- Property Set - plugin descriptor (read/write)
- Default - none set
- Valid Values - the name of any described parameter
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.
The plugin can be slaved to multiple parameters (setting index 0, then index 1 etc...)
*/
#define kOfxImageEffectPropClipPreferencesSlaveParam "OfxImageEffectPropClipPreferencesSlaveParam"
/** @brief Indicates whether the host will let a plugin set the frame rate of the output clip.
- Type - int X 1
- Property Set - host descriptor (read only)
- Valid Values - This must be one of
- 0 - in which case the plugin may not change the frame rate of the output clip,
- 1 - which means a plugin is able to change the output clip's frame rate in the ::kOfxImageEffectActionGetClipPreferences action.
See \ref ImageEffectClipPreferences.
If a clip can be continously sampled, the frame rate will be set to 0.
*/
#define kOfxImageEffectPropSetableFrameRate "OfxImageEffectPropSetableFrameRate"
/** @brief Indicates whether the host will let a plugin set the fielding of the output clip.
- Type - int X 1
- Property Set - host descriptor (read only)
- Valid Values - This must be one of
- 0 - in which case the plugin may not change the fielding of the output clip,
- 1 - which means a plugin is able to change the output clip's fielding in the ::kOfxImageEffectActionGetClipPreferences action.
See \ref ImageEffectClipPreferences.
*/
#define kOfxImageEffectPropSetableFielding "OfxImageEffectPropSetableFielding"
/** @brief Indicates whether a plugin needs sequential rendering, and a host support it
- Type - int X 1
- Property Set - plugin descriptor (read/write) or plugin instance (read/write), and host descriptor (read only)
- Default - 0
- Valid Values -
- 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,
- 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,
- 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
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.
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.
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.
In all cases, a host will set the kOfxImageEffectPropSequentialRenderStatus flag to indicate its sequential render status.
*/
#define kOfxImageEffectInstancePropSequentialRender "OfxImageEffectInstancePropSequentialRender"
/** @brief Property on all the render action that indicate the current sequential render status of a host
- Type - int X 1
- Property Set - read only property on the inArgs of the following actions...
- ::kOfxImageEffectActionBeginSequenceRender
- ::kOfxImageEffectActionRender
- ::kOfxImageEffectActionEndSequenceRender
- Valid Values -
- 0 - the host is not currently sequentially rendering,
- 1 - the host is currentely rendering in a way so that it guarantees sequential rendering.
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.
*/
#define kOfxImageEffectPropSequentialRenderStatus "OfxImageEffectPropSequentialRenderStatus"
#define kOfxHostNativeOriginBottomLeft "kOfxImageEffectHostPropNativeOriginBottomLeft"
#define kOfxHostNativeOriginTopLeft "kOfxImageEffectHostPropNativeOriginTopLeft"
#define kOfxHostNativeOriginCenter "kOfxImageEffectHostPropNativeOriginCenter"
/** @brief Property that indicates the host native UI space - this is only a UI hint, has no impact on pixel processing
- Type - UTF8 string X 1
- Property Set - read only property (host)
- Valid Values -
"kOfxImageEffectHostPropNativeOriginBottomLeft" - 0,0 bottom left
"kOfxImageEffectHostPropNativeOriginTopLeft" - 0,0 top left
"kOfxImageEffectHostPropNativeOriginCenter" - 0,0 center (screen space)
This property is set to kOfxHostNativeOriginBottomLeft pre V1.4 and was to be discovered by plug-ins. This is useful for drawing overlay for points... so everything matches the rest of the app (for example expression linking to other tools, or simply match the reported location of the host viewer).
*/
#define kOfxImageEffectHostPropNativeOrigin "OfxImageEffectHostPropNativeOrigin"
/** @brief Property that indicates if a plugin is being rendered in response to user interaction.
- Type - int X 1
- Property Set - read only property on the inArgs of the following actions...
- ::kOfxImageEffectActionBeginSequenceRender
- ::kOfxImageEffectActionRender
- ::kOfxImageEffectActionEndSequenceRender
- Valid Values -
- 0 - the host is rendering the instance due to some reason other than an interactive tweak on a UI,
- 1 - the instance is being rendered because a user is modifying parameters in an interactive session.
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.
*/
#define kOfxImageEffectPropInteractiveRenderStatus "OfxImageEffectPropInteractiveRenderStatus"
/** @brief Indicates the effect group for this plugin.
- Type - UTF8 string X 1
- Property Set - plugin descriptor (read/write)
- Default - ""
This is purely a user interface hint for the host so it can group related effects on any menus it may have.
*/
#define kOfxImageEffectPluginPropGrouping "OfxImageEffectPluginPropGrouping"
/** @brief Indicates whether a host support image effect \ref ImageEffectOverlays.
- Type - int X 1
- Property Set - host descriptor (read only)
- Valid Values - This must be one of
- 0 - the host won't allow a plugin to draw a GUI over the output image,
- 1 - the host will allow a plugin to draw a GUI over the output image.
*/
#define kOfxImageEffectPropSupportsOverlays "OfxImageEffectPropSupportsOverlays"
/** @brief Sets the entry for an effect's overlay interaction
- Type - pointer X 1
- Property Set - plugin descriptor (read/write)
- Default - NULL
- Valid Values - must point to an ::OfxPluginEntryPoint
The entry point pointed to must be one that handles custom interaction actions.
*/
#define kOfxImageEffectPluginPropOverlayInteractV1 "OfxImageEffectPluginPropOverlayInteractV1"
/** @brief Sets the entry for an effect's overlay interaction. Unlike
kOfxImageEffectPluginPropOverlayInteractV1, the overlay interact in the plug-in is expected
to implement the kOfxInteractActionDraw using the OfxDrawSuiteV1.
- Type - pointer X 1
- Property Set - plugin descriptor (read/write)
- Default - NULL
- Valid Values - must point to an ::OfxPluginEntryPoint
The entry point pointed to must be one that handles custom interaction actions.
*/
#define kOfxImageEffectPluginPropOverlayInteractV2 "OfxImageEffectPluginPropOverlayInteractV2"
/** @brief Indicates whether a plugin or host support multiple resolution images.
- Type - int X 1
- Property Set - host descriptor (read only), plugin descriptor (read/write)
- Default - 1 for plugins
- Valid Values - This must be one of
- 0 - the plugin or host does not support multiple resolutions
- 1 - the plugin or host does support multiple resolutions
Multiple resolution images mean...
- input and output images can be of any size
- input and output images can be offset from the origin
*/
#define kOfxImageEffectPropSupportsMultiResolution "OfxImageEffectPropSupportsMultiResolution"
/** @brief Indicates whether a clip, plugin or host supports tiled images
- Type - int X 1
- Property Set - host descriptor (read only), plugin descriptor (read/write), clip descriptor (read/write), instance (read/write)
- Default - to 1 for a plugin and clip
- Valid Values - This must be one of 0 or 1
Tiled images mean that input or output images can contain pixel data that is only a subset of their full RoD.
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.
V1.4: It is now possible (defined) to change OfxImageEffectPropSupportsTiles in Instance Changed
*/
#define kOfxImageEffectPropSupportsTiles "OfxImageEffectPropSupportsTiles"
/** @brief Indicates support for random temporal access to images in a clip.
- Type - int X 1
- Property Set - host descriptor (read only), plugin descriptor (read/write), clip descriptor (read/write)
- Default - to 0 for a plugin and clip
- Valid Values - This must be one of 0 or 1
On a host, it indicates whether the host supports temporal access to images.
On a plugin, indicates if the plugin needs temporal access to images.
On a clip, it indicates that the clip needs temporal access to images.
*/
#define kOfxImageEffectPropTemporalClipAccess "OfxImageEffectPropTemporalClipAccess"
/** @brief Indicates the context a plugin instance has been created for.
- Type - string X 1
- Property Set - image effect instance (read only)
- Valid Values - This must be one of
- ::kOfxImageEffectContextGenerator
- ::kOfxImageEffectContextFilter
- ::kOfxImageEffectContextTransition
- ::kOfxImageEffectContextPaint
- ::kOfxImageEffectContextGeneral
- ::kOfxImageEffectContextRetimer
*/
#define kOfxImageEffectPropContext "OfxImageEffectPropContext"
/** @brief Indicates the type of each component in a clip or image (after any mapping)
- Type - string X 1
- Property Set - clip instance (read only), image instance (read only)
- Valid Values - This must be one of
- kOfxBitDepthNone (implying a clip is unconnected, not valid for an image)
- kOfxBitDepthByte
- kOfxBitDepthShort
- kOfxBitDepthHalf
- kOfxBitDepthFloat
Note that for a clip, this is the value set by the clip preferences action, not the raw 'actual' value of the clip.
*/
#define kOfxImageEffectPropPixelDepth "OfxImageEffectPropPixelDepth"
/** @brief Indicates the current component type in a clip or image (after any mapping)
- Type - string X 1
- Property Set - clip instance (read only), image instance (read only)
- Valid Values - This must be one of
- kOfxImageComponentNone (implying a clip is unconnected, not valid for an image)
- kOfxImageComponentRGBA
- kOfxImageComponentRGB
- kOfxImageComponentAlpha
Note that for a clip, this is the value set by the clip preferences action, not the raw 'actual' value of the clip.
*/
#define kOfxImageEffectPropComponents "OfxImageEffectPropComponents"
/** @brief Uniquely labels an image
- Type - ASCII string X 1
- Property Set - image instance (read only)
This is host set and allows a plug-in to differentiate between images. This is especially
useful if a plugin caches analysed information about the image (for example motion vectors). The plugin can label the
cached information with this identifier. If a user connects a different clip to the analysed input, or the image has changed in some way
then the plugin can detect this via an identifier change and re-evaluate the cached information.
*/
#define kOfxImagePropUniqueIdentifier "OfxImagePropUniqueIdentifier"
/** @brief Clip and action argument property which indicates that the clip can be sampled continously
- Type - int X 1
- Property Set - clip instance (read only), as an out argument to ::kOfxImageEffectActionGetClipPreferences action (read/write)
- Default - 0 as an out argument to the ::kOfxImageEffectActionGetClipPreferences action
- Valid Values - This must be one of...
- 0 if the images can only be sampled at discreet times (eg: the clip is a sequence of frames),
- 1 if the images can only be sampled continuously (eg: the clip is infact an animating roto spline and can be rendered anywhen).
If this is set to true, then the frame rate of a clip is effectively infinite, so to stop arithmetic
errors the frame rate should then be set to 0.
*/
#define kOfxImageClipPropContinuousSamples "OfxImageClipPropContinuousSamples"
/** @brief Indicates the type of each component in a clip before any mapping by clip preferences
- Type - string X 1
- Property Set - clip instance (read only)
- Valid Values - This must be one of
- kOfxBitDepthNone (implying a clip is unconnected image)
- kOfxBitDepthByte
- kOfxBitDepthShort
- kOfxBitDepthHalf
- kOfxBitDepthFloat
This is the actual value of the component depth, before any mapping by clip preferences.
*/
#define kOfxImageClipPropUnmappedPixelDepth "OfxImageClipPropUnmappedPixelDepth"
/** @brief Indicates the current 'raw' component type on a clip before any mapping by clip preferences
- Type - string X 1
- Property Set - clip instance (read only),
- Valid Values - This must be one of
- kOfxImageComponentNone (implying a clip is unconnected)
- kOfxImageComponentRGBA
- kOfxImageComponentRGB
- kOfxImageComponentAlpha
*/
#define kOfxImageClipPropUnmappedComponents "OfxImageClipPropUnmappedComponents"
/** @brief Indicates the premultiplication state of a clip or image
- Type - string X 1
- Property Set - clip instance (read only), image instance (read only), out args property in the ::kOfxImageEffectActionGetClipPreferences action (read/write)
- Valid Values - This must be one of
- kOfxImageOpaque - the image is opaque and so has no premultiplication state
- kOfxImagePreMultiplied - the image is premultiplied by its alpha
- kOfxImageUnPreMultiplied - the image is unpremultiplied
See the documentation on clip preferences for more details on how this is used with the ::kOfxImageEffectActionGetClipPreferences action.
*/
#define kOfxImageEffectPropPreMultiplication "OfxImageEffectPropPreMultiplication"
/** Used to flag the alpha of an image as opaque */
#define kOfxImageOpaque "OfxImageOpaque"
/** Used to flag an image as premultiplied */
#define kOfxImagePreMultiplied "OfxImageAlphaPremultiplied"
/** Used to flag an image as unpremultiplied */
#define kOfxImageUnPreMultiplied "OfxImageAlphaUnPremultiplied"
/** @brief Indicates the bit depths support by a plug-in or host
- Type - string X N
- Property Set - host descriptor (read only), plugin descriptor (read/write)
- Default - plugin descriptor none set
- Valid Values - This must be one of
- kOfxBitDepthNone (implying a clip is unconnected, not valid for an image)
- kOfxBitDepthByte
- kOfxBitDepthShort
- kOfxBitDepthHalf
- kOfxBitDepthFloat
The default for a plugin is to have none set, the plugin \em must define at least one in its describe action.
*/
#define kOfxImageEffectPropSupportedPixelDepths "OfxImageEffectPropSupportedPixelDepths"
/** @brief Indicates the components supported by a clip or host,