Banuba SDK
BNBEffect.h
Go to the documentation of this file.
1 // AUTOGENERATED FILE - DO NOT MODIFY!
2 // This file was generated by Djinni from effect_player.djinni
3 
4 #import "BNBEffectStatus.h"
5 #import "BNBScene.h"
6 #import <Foundation/Foundation.h>
7 @protocol BNBJsCallback;
8 
9 
10 
11 #ifndef DJINNI_EXPORT
12  #define DJINNI_EXPORT __attribute__((__visibility__("default")))
13 #endif
14 
16 @interface BNBEffect : NSObject
17 
18 /** Thread-safe. May be called from any thread */
19 - (nonnull NSString *)url;
20 
21 /**
22  * Call js method in effect.
23  * @param methodName JS global function name. Member functions are not supported.
24  * @param params Function arguments.
25  * @depreacted Use `evalJs` instead.
26  */
27 - (void)callJsMethod:(nonnull NSString *)methodName
28  params:(nonnull NSString *)params;
29 
30 /**
31  * Evaluate the `script` in effect. This method is thread safe.
32  * @param sctipt JS string to execute
33  * @param js_callback Callback for result, will be called in render thread.
34  */
35 - (void)evalJs:(nonnull NSString *)script
36 resultCallback:(nullable id<BNBJsCallback>)resultCallback;
37 
38 /**
39  * Evaluate the `script` in effect.
40  * MUST be called from the render thread
41  * @param sctipt JS string to execute
42  * @return JS evaluation result
43  */
44 - (nonnull NSString *)evalJsSync:(nonnull NSString *)script;
45 
46 /**
47  * Reset effect state
48  * MUST be called from the render thread
49  */
50 - (void)reset;
51 
52 /**
53  * Update effect state (evaluate scheduled JS calls)
54  * MUST be called from the render thread
55  */
56 - (void)update;
57 
58 /**
59  * If effect is based on Scene engine and it is activated completly - returns Scene object from the effect.
60  * Otherwise returns null.
61  * MUST be called from the render thread
62  * Returned Scene object MUST be used only from the render thread and only while the effect is in the activated state.
63  */
64 - (nullable BNBScene *)scene;
65 
66 /**
67  * Deserialize effect from the provided `resoved_url`. If `configOverride` is an
68  * empty string, will use `config.json` under provided `resolvedUrl`, otherwise
69  * content of `configOverride` will be used.
70  *
71  * Can be called from any thread.
72  */
73 - (void)deserialize:(nonnull NSString *)resolvedUrl
74  configOverride:(nonnull NSString *)configOverride;
75 
76 /**
77  * activate current effect
78  * MUST be called from the render thread for OpenGL backends.
79  */
80 - (void)activate:(int32_t)fxWidth
81  fxHeight:(int32_t)fxHeight
82  surfaceWidth:(int32_t)surfaceWidth
83  surfaceHeight:(int32_t)surfaceHeight;
84 
85 - (void)dumpFs:(nonnull NSString *)outDir;
86 
87 - (void)dump;
88 
89 - (nonnull NSString *)dumpJson;
90 
91 - (BNBEffectStatus)status;
92 
93 @end
-[BNBEffect update]
void update()
Update effect state (evaluate scheduled JS calls) MUST be called from the render thread.
-[BNBEffect dump]
void dump()
BNBEffectStatus.h
-[BNBEffect scene]
nullable BNBScene * scene()
If effect is based on Scene engine and it is activated completly - returns Scene object from the effe...
-[BNBEffect status]
BNBEffectStatus status()
BNBJsCallback-p
Callback for JS execution results.
Definition: BNBJsCallback.h:8
-[BNBEffect dumpJson]
nonnull NSString * dumpJson()
BNBEffect
Definition: BNBEffect.h:16
DJINNI_EXPORT
#define DJINNI_EXPORT
for order of values in action units array see action_units_indices enum
Definition: BNBActionUnits.h:9
BNBScene
A class representing a displayable scene.
Definition: BNBScene.h:30
-[BNBEffect url]
nonnull NSString * url()
Thread-safe.
-[BNBEffect reset]
void reset()
Reset effect state MUST be called from the render thread.
BNBScene.h