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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
#ifndef _ofxImageEffect_h_
#define _ofxImageEffect_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 "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,
- Type - string X N
- Property Set - host descriptor (read only), clip descriptor (read/write)
- Valid Values - This must be one of
- kOfxImageComponentNone (implying a clip is unconnected)
- kOfxImageComponentRGBA
- kOfxImageComponentRGB
- kOfxImageComponentAlpha
This list of strings indicate what component types are supported by a host or are expected as input to a clip.
The default for a clip descriptor is to have none set, the plugin \em must define at least one in its define function
*/
#define kOfxImageEffectPropSupportedComponents "OfxImageEffectPropSupportedComponents"
/** @brief Indicates if a clip is optional.
- Type - int X 1
- Property Set - clip descriptor (read/write)
- Default - 0
- Valid Values - This must be one of 0 or 1
*/
#define kOfxImageClipPropOptional "OfxImageClipPropOptional"
/** @brief Indicates that a clip is intended to be used as a mask input
- Type - int X 1
- Property Set - clip descriptor (read/write)
- Default - 0
- Valid Values - This must be one of 0 or 1
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.
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.
*/
#define kOfxImageClipPropIsMask "OfxImageClipPropIsMask"
/** @brief The pixel aspect ratio of a clip or image.
- Type - double X 1
- Property Set - clip instance (read only), image instance (read only) and ::kOfxImageEffectActionGetClipPreferences action out args property (read/write)
*/
#define kOfxImagePropPixelAspectRatio "OfxImagePropPixelAspectRatio"
/** @brief The frame rate of a clip or instance's project.
- Type - double X 1
- Property Set - clip instance (read only), effect instance (read only) and ::kOfxImageEffectActionGetClipPreferences action out args property (read/write)
For an input clip this is the frame rate of the clip.
For an output clip, the frame rate mapped via pixel preferences.
For an instance, this is the frame rate of the project the effect is in.
For the outargs property in the ::kOfxImageEffectActionGetClipPreferences action, it is used to change the frame rate of the ouput clip.
*/
#define kOfxImageEffectPropFrameRate "OfxImageEffectPropFrameRate"
/** @brief Indicates the original unmapped frame rate (frames/second) of a clip
- Type - double X 1
- Property Set - clip instance (read only),
If a plugin changes the output frame rate in the pixel preferences action, this property allows a plugin to get to the original value.
*/
#define kOfxImageEffectPropUnmappedFrameRate "OfxImageEffectPropUnmappedFrameRate"
/** @brief The frame step used for a sequence of renders
- Type - double X 1
- Property Set - an in argument for the ::kOfxImageEffectActionBeginSequenceRender action (read only)
- Valid Values - can be any positive value, but typically
- 1 for frame based material
- 0.5 for field based material
*/
#define kOfxImageEffectPropFrameStep "OfxImageEffectPropFrameStep"
/** @brief The frame range over which a clip has images.
- Type - double X 2
- Property Set - clip instance (read only)
Dimension 0 is the first frame for which the clip can produce valid data.
Dimension 1 is the last frame for which the clip can produce valid data.
*/
#define kOfxImageEffectPropFrameRange "OfxImageEffectPropFrameRange"
/** @brief The unmaped frame range over which an output clip has images.
- Type - double X 2
- Property Set - clip instance (read only)
Dimension 0 is the first frame for which the clip can produce valid data.
Dimension 1 is the last frame for which the clip can produce valid data.
If a plugin changes the output frame rate in the pixel preferences action, it will affect the frame range
of the output clip, this property allows a plugin to get to the original value.
*/
#define kOfxImageEffectPropUnmappedFrameRange "OfxImageEffectPropUnmappedFrameRange"
/** @brief Says whether the clip is actually connected at the moment.
- Type - int X 1
- Property Set - clip instance (read only)
- Valid Values - This must be one of 0 or 1
An instance may have a clip may not be connected to an object that can produce image data. Use this to find out.
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.
*/
#define kOfxImageClipPropConnected "OfxImageClipPropConnected"
/** @brief Indicates whether an effect will generate different images from frame to frame.
- Type - int X 1
- Property Set - out argument to ::kOfxImageEffectActionGetClipPreferences action (read/write).
- Default - 0
- Valid Values - This must be one of 0 or 1
This property indicates whether a plugin will generate a different image from frame to frame, even if no parameters
or input image changes. For example a generater that creates random noise pixel at each frame.
*/
#define kOfxImageEffectFrameVarying "OfxImageEffectFrameVarying"
/** @brief The proxy render scale currently being applied.
- Type - double X 2
- Property Set - an image instance (read only) and as read only an in argument on the following actions,
- ::kOfxImageEffectActionRender
- ::kOfxImageEffectActionBeginSequenceRender
- ::kOfxImageEffectActionEndSequenceRender
- ::kOfxImageEffectActionIsIdentity
- ::kOfxImageEffectActionGetRegionOfDefinition
- ::kOfxImageEffectActionGetRegionsOfInterest
- ::kOfxActionInstanceChanged
- ::kOfxInteractActionDraw
- ::kOfxInteractActionPenMotion
- ::kOfxInteractActionPenDown
- ::kOfxInteractActionPenUp
- ::kOfxInteractActionKeyDown
- ::kOfxInteractActionKeyUp
- ::kOfxInteractActionKeyRepeat
- ::kOfxInteractActionGainFocus
- ::kOfxInteractActionLoseFocus
This should be applied to any spatial parameters to position them correctly. Not that the 'x' value does not include any pixel aspect ratios.
*/
#define kOfxImageEffectPropRenderScale "OfxImageEffectPropRenderScale"
/** @brief Indicates whether an effect can take quality shortcuts to improve speed.
- Type - int X 1
- Property Set - render calls, host (read-only)
- Default - 0 - 0: Best Quality (1: Draft)
- Valid Values - This must be one of 0 or 1
This property indicates that the host provides the plug-in the option to render in Draft/Preview mode. This is useful for applications that must support fast scrubbing. These allow a plug-in to take short-cuts for improved performance when the situation allows and it makes sense, for example to generate thumbnails with effects applied.
For example switch to a cheaper interpolation type or rendering mode. A plugin should expect frames rendered in this manner that will not be stucked in host cache unless the cache is only used in the same draft situations.
If an host does not support that property a value of 0 is assumed.
Also note that some hosts do implement kOfxImageEffectPropRenderScale - these two properties can be used independently.
*/
#define kOfxImageEffectPropRenderQualityDraft "OfxImageEffectPropRenderQualityDraft"
/** @brief The extent of the current project in canonical coordinates.
- Type - double X 2
- Property Set - a plugin instance (read only)
The extent is the size of the 'output' for the current project. See \ref NormalisedCoordinateSystem for more infomation on the project extent.
The extent is in canonical coordinates and only returns the top right position, as the extent is always rooted at 0,0.
For example a PAL SD project would have an extent of 768, 576.
*/
#define kOfxImageEffectPropProjectExtent "OfxImageEffectPropProjectExtent"
/** @brief The size of the current project in canonical coordinates.
- Type - double X 2
- Property Set - a plugin instance (read only)
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.
The project size is in canonical coordinates.
See \ref NormalisedCoordinateSystem for more infomation on the project extent.
*/
#define kOfxImageEffectPropProjectSize "OfxImageEffectPropProjectSize"
/** @brief The offset of the current project in canonical coordinates.
- Type - double X 2
- Property Set - a plugin instance (read only)
The offset is related to the ::kOfxImageEffectPropProjectSize and is the offset from the origin of the project 'subwindow'.
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.
The project offset is in canonical coordinates.
See \ref NormalisedCoordinateSystem for more infomation on the project extent.
*/
#define kOfxImageEffectPropProjectOffset "OfxImageEffectPropProjectOffset"
/** @brief The pixel aspect ratio of the current project
- Type - double X 1
- Property Set - a plugin instance (read only)
*/
#define kOfxImageEffectPropProjectPixelAspectRatio "OfxImageEffectPropPixelAspectRatio"
/** @brief The duration of the effect
- Type - double X 1
- Property Set - a plugin instance (read only)
This contains the duration of the plug-in effect, in frames.
*/
#define kOfxImageEffectInstancePropEffectDuration "OfxImageEffectInstancePropEffectDuration"
/** @brief Which spatial field occurs temporally first in a frame.
- Type - string X 1
- Property Set - a clip instance (read only)
- Valid Values - This must be one of
- ::kOfxImageFieldNone - the material is unfielded
- ::kOfxImageFieldLower - the material is fielded, with image rows 0,2,4.... occuring first in a frame
- ::kOfxImageFieldUpper - the material is fielded, with image rows line 1,3,5.... occuring first in a frame
*/
#define kOfxImageClipPropFieldOrder "OfxImageClipPropFieldOrder"
/** @brief The pixel data pointer of an image.
- Type - pointer X 1
- Property Set - an image instance (read only)
This property contains one of:
- a pointer to memory that is the lower left hand corner of an image
- a pointer to Cuda memory, if the Render action arguments includes kOfxImageEffectPropCudaEnabled=1
- an id<MTLBuffer>, if the Render action arguments includes kOfxImageEffectPropMetalEnabled=1
- a cl_mem, if the Render action arguments includes kOfxImageEffectPropOpenCLEnabled=1
See \ref kOfxImageEffectPropCudaEnabled, \ref kOfxImageEffectPropMetalEnabled and \ref kOfxImageEffectPropOpenCLEnabled
*/
#define kOfxImagePropData "OfxImagePropData"
/** @brief The bounds of an image's pixels.
- Type - integer X 4
- Property Set - an image instance (read only)
The bounds, in \ref PixelCoordinates, are of the addressable pixels in an image's data pointer.
The order of the values is x1, y1, x2, y2.
X values are x1 <= X < x2
Y values are y1 <= Y < y2
For less than full frame images, the pixel bounds will be contained by the ::kOfxImagePropRegionOfDefinition bounds.
*/
#define kOfxImagePropBounds "OfxImagePropBounds"
/** @brief The full region of definition of an image.
- Type - integer X 4
- Property Set - an image instance (read only)
An image's region of definition, in \ref PixelCoordinates, is the full frame area of the image plane that the image covers.
The order of the values is x1, y1, x2, y2.
X values are x1 <= X < x2
Y values are y1 <= Y < y2
The ::kOfxImagePropBounds property contains the actuall addressable pixels in an image, which may be less than its full region of definition.
*/
#define kOfxImagePropRegionOfDefinition "OfxImagePropRegionOfDefinition"
/** @brief The number of bytes in a row of an image.
- Type - integer X 1
- Property Set - an image instance (read only)
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.
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
is fetched from the ::kOfxImagePropBounds property.
Note that (for CPU images only, not Cuda/Metal/OpenCL buffers, nor textures accessed via the OpenGL Render Suite) 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.
*/
#define kOfxImagePropRowBytes "OfxImagePropRowBytes"
/** @brief Which fields are present in the image
- Type - string X 1
- Property Set - an image instance (read only)
- Valid Values - This must be one of
- ::kOfxImageFieldNone - the image is an unfielded frame
- ::kOfxImageFieldBoth - the image is fielded and contains both interlaced fields
- ::kOfxImageFieldLower - the image is fielded and contains a single field, being the lower field (rows 0,2,4...)
- ::kOfxImageFieldUpper - the image is fielded and contains a single field, being the upper field (rows 1,3,5...)
*/
#define kOfxImagePropField "OfxImagePropField"
/** @brief Controls how a plugin renders fielded footage.
- Type - integer X 1
- Property Set - a plugin descriptor (read/write)
- Default - 1
- Valid Values - This must be one of
- 0 - the plugin is to have its render function called twice, only if there is animation in any of its parameters
- 1 - the plugin is to have its render function called twice always
*/
#define kOfxImageEffectPluginPropFieldRenderTwiceAlways "OfxImageEffectPluginPropFieldRenderTwiceAlways"
/** @brief Controls how a plugin fetched fielded imagery from a clip.
- Type - string X 1
- Property Set - a clip descriptor (read/write)
- Default - kOfxImageFieldDoubled
- Valid Values - This must be one of
- kOfxImageFieldBoth - fetch a full frame interlaced image
- kOfxImageFieldSingle - fetch a single field, making a half height image
- kOfxImageFieldDoubled - fetch a single field, but doubling each line and so making a full height image
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.
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.
*/
#define kOfxImageClipPropFieldExtraction "OfxImageClipPropFieldExtraction"
/** @brief Indicates which field is being rendered.
- Type - string X 1
- Property Set - a read only in argument property to ::kOfxImageEffectActionRender and ::kOfxImageEffectActionIsIdentity
- Valid Values - this must be one of
- kOfxImageFieldNone - there are no fields to deal with, all images are full frame
- kOfxImageFieldBoth - the imagery is fielded and both scan lines should be renderred
- kOfxImageFieldLower - the lower field is being rendered (lines 0,2,4...)
- kOfxImageFieldUpper - the upper field is being rendered (lines 1,3,5...)
*/
#define kOfxImageEffectPropFieldToRender "OfxImageEffectPropFieldToRender"
/** @brief Used to indicate the region of definition of a plug-in
- Type - double X 4
- Property Set - a read/write out argument property to the ::kOfxImageEffectActionGetRegionOfDefinition action
- Default - see ::kOfxImageEffectActionGetRegionOfDefinition
The order of the values is x1, y1, x2, y2.
This will be in \ref CanonicalCoordinates
*/
#define kOfxImageEffectPropRegionOfDefinition "OfxImageEffectPropRegionOfDefinition"
/** @brief The value of a region of interest.
- Type - double X 4
- Property Set - a read only in argument property to the ::kOfxImageEffectActionGetRegionsOfInterest action
A host passes this value into the region of interest action to specify the region it is interested in rendering.
The order of the values is x1, y1, x2, y2.
This will be in \ref CanonicalCoordinates.
*/
#define kOfxImageEffectPropRegionOfInterest "OfxImageEffectPropRegionOfInterest"
/** @brief The region to be rendered.
- Type - integer X 4
- Property Set - a read only in argument property to the ::kOfxImageEffectActionRender and ::kOfxImageEffectActionIsIdentity actions
The order of the values is x1, y1, x2, y2.
This will be in \ref PixelCoordinates
*/
#define kOfxImageEffectPropRenderWindow "OfxImageEffectPropRenderWindow"
/** @brief Indicates whether a host or plugin can support Cuda render
- Type - string X 1
- Property Set - plugin descriptor (read/write), host descriptor (read only)
- Default - "false"
- Valid Values - This must be one of
- "false" - the host or plugin does not support Cuda render
- "true" - the host or plugin can support Cuda render
*/
#define kOfxImageEffectPropCudaRenderSupported "OfxImageEffectPropCudaRenderSupported"
/** @brief Indicates that an image effect SHOULD use Cuda render in
the current action
If a plugin and host have both set
kOfxImageEffectPropCudaRenderSupported="true" then the host MAY set
this property to indicate that it is passing images as Cuda memory
pointers.
- Type - int X 1
- Property Set - inArgs property set of the kOfxImageEffectActionRender action
- Valid Values
- 0 indicates that the kOfxImagePropData of each image of each clip
is a CPU memory pointer.
- 1 indicates that the kOfxImagePropData of each image of each clip
is a Cuda memory pointer.
*/
#define kOfxImageEffectPropCudaEnabled "OfxImageEffectPropCudaEnabled"
/** @brief Indicates whether a host or plugin can support Cuda streams
- Type - string X 1
- Property Set - plugin descriptor (read/write), host descriptor (read only)
- Default - "false"
- Valid Values - This must be one of
- "false" - in which case the host or plugin does not support Cuda streams
- "true" - which means a host or plugin can support Cuda streams
*/
#define kOfxImageEffectPropCudaStreamSupported "OfxImageEffectPropCudaStreamSupported"
/** @brief The Cuda stream to be used for rendering
- Type - pointer X 1
- Property Set - inArgs property set of the kOfxImageEffectActionRender action
This property will only be set if the host and plugin both support Cuda streams.
If set:
- this property contains a pointer to the stream of Cuda render (cudaStream_t).
In order to use it, reinterpret_cast<cudaStream_t>(pointer) is needed.
- the plugin SHOULD ensure that its render action enqueues any
asynchronous Cuda operations onto the supplied queue.
- the plugin SHOULD NOT wait for final asynchronous operations to
complete before returning from the render action, and SHOULD NOT
call cudaDeviceSynchronize() at any time.
If not set:
- the plugin SHOULD ensure that any asynchronous operations it
enqueues have completed before returning from the render action.
*/
#define kOfxImageEffectPropCudaStream "OfxImageEffectPropCudaStream"
/** @brief Indicates whether a host or plugin can support Metal render
- Type - string X 1
- Property Set - plugin descriptor (read/write), host descriptor (read only)
- Default - "false"
- Valid Values - This must be one of
- "false" - the host or plugin does not support Metal render
- "true" - the host or plugin can support Metal render
*/
#define kOfxImageEffectPropMetalRenderSupported "OfxImageEffectPropMetalRenderSupported"
/** @brief Indicates that an image effect SHOULD use Metal render in
the current action
If a plugin and host have both set
kOfxImageEffectPropMetalRenderSupported="true" then the host MAY
set this property to indicate that it is passing images as Metal
buffers.
- Type - int X 1
- Property Set - inArgs property set of the kOfxImageEffectActionRender action
- Valid Values
- 0 indicates that the kOfxImagePropData of each image of each clip
is a CPU memory pointer.
- 1 indicates that the kOfxImagePropData of each image of each clip
is a Metal id<MTLBuffer>.
*/
#define kOfxImageEffectPropMetalEnabled "OfxImageEffectPropMetalEnabled"
/** @brief The command queue of Metal render
- Type - pointer X 1
- Property Set - inArgs property set of the kOfxImageEffectActionRender action
This property contains a pointer to the command queue to be used for
Metal rendering (id<MTLCommandQueue>). In order to use it,
reinterpret_cast<id<MTLCommandQueue>>(pointer) is needed.
The plugin SHOULD ensure that its render action enqueues any
asynchronous Metal operations onto the supplied queue.
The plugin SHOULD NOT wait for final asynchronous operations to
complete before returning from the render action.
*/
#define kOfxImageEffectPropMetalCommandQueue "OfxImageEffectPropMetalCommandQueue"
/** @brief Indicates whether a host or plugin can support OpenCL render
- Type - string X 1
- Property Set - plugin descriptor (read/write), host descriptor (read only)
- Default - "false"
- Valid Values - This must be one of
- "false" - the host or plugin does not support OpenCL render
- "true" - the host or plugin can support OpenCL render
*/
#define kOfxImageEffectPropOpenCLRenderSupported "OfxImageEffectPropOpenCLRenderSupported"
/** @brief Indicates that an image effect SHOULD use OpenCL render in
the current action
If a plugin and host have both set
kOfxImageEffectPropOpenCLRenderSupported="true" then the host MAY
set this property to indicate that it is passing images as OpenCL
buffers.
- Type - int X 1
- Property Set - inArgs property set of the kOfxImageEffectActionRender action
- Valid Values
- 0 indicates that the kOfxImagePropData of each image of each clip
is a CPU memory pointer.
- 1 indicates that the kOfxImagePropData of each image of each clip
is a cl_mem.
*/
#define kOfxImageEffectPropOpenCLEnabled "OfxImageEffectPropOpenCLEnabled"
/** @brief The command queue of OpenCL render
- Type - pointer X 1
- Property Set - inArgs property set of the kOfxImageEffectActionRender action
This property contains a pointer to the command queue to be used for
Metal rendering (cl_command_queue). In order to use it,
reinterpret_cast<cl_command_queue>(pointer) is needed.
The plugin SHOULD ensure that its render action enqueues any
asynchronous OpenCL operations onto the supplied queue.
The plugin SHOULD NOT wait for final asynchronous operations to
complete before returning from the render action.
*/
#define kOfxImageEffectPropOpenCLCommandQueue "OfxImageEffectPropOpenCLCommandQueue"
/** String used to label imagery as having no fields */
#define kOfxImageFieldNone "OfxFieldNone"
/** String used to label the lower field (scan lines 0,2,4...) of fielded imagery */
#define kOfxImageFieldLower "OfxFieldLower"
/** String used to label the upper field (scan lines 1,3,5...) of fielded imagery */
#define kOfxImageFieldUpper "OfxFieldUpper"
/** String used to label both fields of fielded imagery, indicating interlaced footage */
#define kOfxImageFieldBoth "OfxFieldBoth"
/** String used to label an image that consists of a single field, and so is half height */
#define kOfxImageFieldSingle "OfxFieldSingle"
/** String used to label an image that consists of a single field, but each scan line is double,
and so is full height */
#define kOfxImageFieldDoubled "OfxFieldDoubled"
/*@}*/
/*@}*/
/** @brief String that is the name of the standard OFX output clip */
#define kOfxImageEffectOutputClipName "Output"
/** @brief String that is the name of the standard OFX single source input clip */
#define kOfxImageEffectSimpleSourceClipName "Source"
/** @brief String that is the name of the 'from' clip in the OFX transition context */
#define kOfxImageEffectTransitionSourceFromClipName "SourceFrom"
/** @brief String that is the name of the 'from' clip in the OFX transition context */
#define kOfxImageEffectTransitionSourceToClipName "SourceTo"
/** @brief the name of the mandated 'Transition' param for the transition context */
#define kOfxImageEffectTransitionParamName "Transition"
/** @brief the name of the mandated 'SourceTime' param for the retime context */
#define kOfxImageEffectRetimerParamName "SourceTime"
/** @brief the string that names image effect suites, passed to OfxHost::fetchSuite */
#define kOfxImageEffectSuite "OfxImageEffectSuite"
/** @brief The OFX suite for image effects
This suite provides the functions needed by a plugin to defined and use an image effect plugin.
*/
typedef struct OfxImageEffectSuiteV1 {
/** @brief Retrieves the property set for the given image effect
\arg imageEffect image effect to get the property set for
\arg propHandle pointer to a the property set pointer, value is returned here
The property handle is for the duration of the image effect handle.
@returns
- ::kOfxStatOK - the property set was found and returned
- ::kOfxStatErrBadHandle - if the paramter handle was invalid
- ::kOfxStatErrUnknown - if the type is unknown
*/
OfxStatus (*getPropertySet)(OfxImageEffectHandle imageEffect,
OfxPropertySetHandle *propHandle);
/** @brief Retrieves the parameter set for the given image effect
\arg imageEffect image effect to get the property set for
\arg paramSet pointer to a the parameter set, value is returned here
The param set handle is valid for the lifetime of the image effect handle.
@returns
- ::kOfxStatOK - the property set was found and returned
- ::kOfxStatErrBadHandle - if the paramter handle was invalid
- ::kOfxStatErrUnknown - if the type is unknown
*/
OfxStatus (*getParamSet)(OfxImageEffectHandle imageEffect,
OfxParamSetHandle *paramSet);
/** @brief Define a clip to the effect.
\arg pluginHandle - the handle passed into 'describeInContext' action
\arg name - unique name of the clip to define
\arg propertySet - a property handle for the clip descriptor will be returned here
This function defines a clip to a host, the returned property set is used to describe
various aspects of the clip to the host. Note that this does not create a clip instance.
\pre
- we are inside the describe in context action.
@returns
*/
OfxStatus (*clipDefine)(OfxImageEffectHandle imageEffect,
const char *name,
OfxPropertySetHandle *propertySet);
/** @brief Get the propery handle of the named input clip in the given instance
\arg imageEffect - an instance handle to the plugin
\arg name - name of the clip, previously used in a clip define call
\arg clip - where to return the clip
\arg propertySet if not null, the descriptor handle for a parameter's property set will be placed here.
The propertySet will have the same value as would be returned by OfxImageEffectSuiteV1::clipGetPropertySet
This return a clip handle for the given instance, note that this will \em not be the same as the
clip handle returned by clipDefine and will be distanct to clip handles in any other instance
of the plugin.
Not a valid call in any of the describe actions.
\pre
- create instance action called,
- \e name passed to clipDefine for this context,
- not inside describe or describe in context actions.
\post
- handle will be valid for the life time of the instance.
*/
OfxStatus (*clipGetHandle)(OfxImageEffectHandle imageEffect,
const char *name,
OfxImageClipHandle *clip,
OfxPropertySetHandle *propertySet);
/** @brief Retrieves the property set for a given clip
\arg clip clip effect to get the property set for
\arg propHandle pointer to a the property set handle, value is returedn her
The property handle is valid for the lifetime of the clip, which is generally the lifetime of the instance.
@returns
- ::kOfxStatOK - the property set was found and returned
- ::kOfxStatErrBadHandle - if the paramter handle was invalid
- ::kOfxStatErrUnknown - if the type is unknown
*/
OfxStatus (*clipGetPropertySet)(OfxImageClipHandle clip,
OfxPropertySetHandle *propHandle);
/** @brief Get a handle for an image in a clip at the indicated time and indicated region
\arg clip - the clip to extract the image from
\arg time - time to fetch the image at
\arg region - region to fetch the image from (optional, set to NULL to get a 'default' region)
this is in the \ref CanonicalCoordinates.
\arg imageHandle - property set containing the image's data
An image is fetched from a clip at the indicated time for the given region and returned in the imageHandle.
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.
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.
\pre
- clip was returned by clipGetHandle
\post
- image handle is only valid for the duration of the action clipGetImage is called in
- image handle to be disposed of by clipReleaseImage before the action returns
@returns
- ::kOfxStatOK - the image was successfully fetched and returned in the handle,
- ::kOfxStatFailed - the image could not be fetched because it does not exist in the clip at the indicated time and/or region, the plugin
should continue operation, but assume the image was black and transparent.
- ::kOfxStatErrBadHandle - the clip handle was invalid,
- ::kOfxStatErrMemory - the host had not enough memory to complete the operation, plugin should abort whatever it was doing.
*/
OfxStatus (*clipGetImage)(OfxImageClipHandle clip,
OfxTime time,
const OfxRectD *region,
OfxPropertySetHandle *imageHandle);
/** @brief Releases the image handle previously returned by clipGetImage
\pre
- imageHandle was returned by clipGetImage
\post
- all operations on imageHandle will be invalid
@returns
- ::kOfxStatOK - the image was successfully fetched and returned in the handle,
- ::kOfxStatErrBadHandle - the image handle was invalid,
*/
OfxStatus (*clipReleaseImage)(OfxPropertySetHandle imageHandle);
/** @brief Returns the spatial region of definition of the clip at the given time
\arg clipHandle - the clip to extract the image from
\arg time - time to fetch the image at
\arg region - region to fetch the image from (optional, set to NULL to get a 'default' region)
this is in the \ref CanonicalCoordinates.
\arg imageHandle - handle where the image is returned
An image is fetched from a clip at the indicated time for the given region and returned in the imageHandle.
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.
\pre
- clipHandle was returned by clipGetHandle
\post
- bounds will be filled the RoD of the clip at the indicated time
@returns
- ::kOfxStatOK - the image was successfully fetched and returned in the handle,
- ::kOfxStatFailed - the image could not be fetched because it does not exist in the clip at the indicated time, the plugin
should continue operation, but assume the image was black and transparent.
- ::kOfxStatErrBadHandle - the clip handle was invalid,
- ::kOfxStatErrMemory - the host had not enough memory to complete the operation, plugin should abort whatever it was doing.
*/
OfxStatus (*clipGetRegionOfDefinition)(OfxImageClipHandle clip,
OfxTime time,
OfxRectD *bounds);
/** @brief Returns whether to abort processing or not.
\arg imageEffect - instance of the image effect
A host may want to signal to a plugin that it should stop whatever rendering it is doing and start again.
Generally this is done in interactive threads in response to users tweaking some parameter.
This function indicates whether a plugin should stop whatever processing it is doing.
@returns
- 0 if the effect should continue whatever processing it is doing
- 1 if the effect should abort whatever processing it is doing
*/
int (*abort)(OfxImageEffectHandle imageEffect);
/** @brief Allocate memory from the host's image memory pool
\arg instanceHandle - effect instance to associate with this memory allocation, may be NULL.
\arg nBytes - the number of bytes to allocate
\arg memoryHandle - pointer to the memory handle where a return value is placed
Memory handles allocated by this should be freed by OfxImageEffectSuiteV1::imageMemoryFree.
To access the memory behind the handle you need to call OfxImageEffectSuiteV1::imageMemoryLock.
See \ref ImageEffectsMemoryAllocation.
@returns
- kOfxStatOK if all went well, a valid memory handle is placed in \e memoryHandle
- kOfxStatErrBadHandle if instanceHandle is not valid, memoryHandle is set to NULL
- kOfxStatErrMemory if there was not enough memory to satisfy the call, memoryHandle is set to NULL
*/
OfxStatus (*imageMemoryAlloc)(OfxImageEffectHandle instanceHandle,
size_t nBytes,
OfxImageMemoryHandle *memoryHandle);
/** @brief Frees a memory handle and associated memory.
\arg memoryHandle - memory handle returned by imageMemoryAlloc
This function frees a memory handle and associated memory that was previously allocated via OfxImageEffectSuiteV1::imageMemoryAlloc
If there are outstanding locks, these are ignored and the handle and memory are freed anyway.
See \ref ImageEffectsMemoryAllocation.
@returns
- kOfxStatOK if the memory was cleanly deleted
- kOfxStatErrBadHandle if the value of \e memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc
*/
OfxStatus (*imageMemoryFree)(OfxImageMemoryHandle memoryHandle);
/** @brief Lock the memory associated with a memory handle and make it available for use.
\arg memoryHandle - memory handle returned by imageMemoryAlloc
\arg returnedPtr - where to the pointer to the locked memory
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.
Note that memory locks and unlocks nest.
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.
Also, if unlocked, then relocked, the memory associated with a memory handle may be at a different address.
See also OfxImageEffectSuiteV1::imageMemoryUnlock and \ref ImageEffectsMemoryAllocation.
@returns
- kOfxStatOK if the memory was locked, a pointer is placed in \e returnedPtr
- kOfxStatErrBadHandle if the value of \e memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc, null is placed in \e *returnedPtr
- kOfxStatErrMemory if there was not enough memory to satisfy the call, \e *returnedPtr is set to NULL
*/
OfxStatus (*imageMemoryLock)(OfxImageMemoryHandle memoryHandle,
void **returnedPtr);
/** @brief Unlock allocated image data
\arg allocatedData - pointer to memory previously returned by OfxImageEffectSuiteV1::imageAlloc
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.
Note that locks and unlocks nest, and to fully unlock memory you need to match the count of locks placed upon it.
Also note, if you unlock a completely unlocked handle, it has no effect (ie: the lock count can't be negative).
If unlocked, then relocked, the memory associated with a memory handle may be at a different address, however the contents will remain the same.
See also OfxImageEffectSuiteV1::imageMemoryLock and \ref ImageEffectsMemoryAllocation.
@returns
- kOfxStatOK if the memory was unlocked cleanly,
- kOfxStatErrBadHandle if the value of \e memoryHandle was not a valid pointer returned by OfxImageEffectSuiteV1::imageMemoryAlloc, null is placed in \e *returnedPtr
*/
OfxStatus (*imageMemoryUnlock)(OfxImageMemoryHandle memoryHandle);
} OfxImageEffectSuiteV1;
/**
\addtogroup StatusCodes
*/
/*@{*/
/**
\defgroup StatusCodesImageEffect Image Effect API Status Codes
These are status codes returned by functions in the OfxImageEffectSuite and Image Effect plugin functions.
They range from 1000 until 1999
*/
/*@{*/
/** @brief Error code for incorrect image formats */
#define kOfxStatErrImageFormat ((int) 1000)
/*@}*/
/*@}*/
#ifdef __cplusplus
}
#endif
#endif