Banuba SDK
Instance Methods | List of all members
BNBEffect Class Reference

#import <BNBEffect.h>

Inheritance diagram for BNBEffect:

Instance Methods

(nonnull NSString *) - url
 Thread-safe. More...
 
(void) - callJsMethod:params:
 Call js method in effect. More...
 
(void) - evalJs:resultCallback:
 Evaluate the script in effect. More...
 
(nonnull NSString *) - evalJsSync:
 Evaluate the script in effect. More...
 
(void) - reset
 Reset effect state MUST be called from the render thread. More...
 
(void) - update
 Update effect state (evaluate scheduled JS calls) MUST be called from the render thread. More...
 
(nullable BNBScene *) - scene
 If effect is based on Scene engine and it is activated completly - returns Scene object from the effect. More...
 
(void) - deserialize:configOverride:
 Deserialize effect from the provided resoved_url. More...
 
(void) - activate:fxHeight:surfaceWidth:surfaceHeight:
 activate current effect MUST be called from the render thread for OpenGL backends. More...
 
(void) - dumpFs:
 
(void) - dump
 
(nonnull NSString *) - dumpJson
 
(BNBEffectStatus) - status
 

Detailed Description

Definition at line 16 of file BNBEffect.h.

Method Documentation

◆ activate:fxHeight:surfaceWidth:surfaceHeight:

- (void) activate: (int32_t)  fxWidth
fxHeight: (int32_t)  fxHeight
surfaceWidth: (int32_t)  surfaceWidth
surfaceHeight: (int32_t)  surfaceHeight 

activate current effect MUST be called from the render thread for OpenGL backends.

◆ callJsMethod:params:

- (void) callJsMethod: (nonnull NSString *)  methodName
params: (nonnull NSString *)  params 

Call js method in effect.

Parameters
methodNameJS global function name. Member functions are not supported.
paramsFunction arguments. @depreacted Use evalJs instead.

◆ deserialize:configOverride:

- (void) deserialize: (nonnull NSString *)  resolvedUrl
configOverride: (nonnull NSString *)  configOverride 

Deserialize effect from the provided resoved_url.

If configOverride is an empty string, will use config.json under provided resolvedUrl, otherwise content of configOverride will be used.

Can be called from any thread.

◆ dump

- (void) dump

◆ dumpFs:

- (void) dumpFs: (nonnull NSString *)  outDir

◆ dumpJson

- (nonnull NSString *) dumpJson

◆ evalJs:resultCallback:

- (void) evalJs: (nonnull NSString *)  script
resultCallback: (nullable id< BNBJsCallback >)  resultCallback 

Evaluate the script in effect.

This method is thread safe.

Parameters
sctiptJS string to execute
js_callbackCallback for result, will be called in render thread.

◆ evalJsSync:

- (nonnull NSString *) evalJsSync: (nonnull NSString *)  script

Evaluate the script in effect.

MUST be called from the render thread

Parameters
sctiptJS string to execute
Returns
JS evaluation result

◆ reset

- (void) reset

Reset effect state MUST be called from the render thread.

◆ scene

- (nullable BNBScene *) scene

If effect is based on Scene engine and it is activated completly - returns Scene object from the effect.

Otherwise returns null. MUST be called from the render thread Returned Scene object MUST be used only from the render thread and only while the effect is in the activated state.

◆ status

- (BNBEffectStatus) status

◆ update

- (void) update

Update effect state (evaluate scheduled JS calls) MUST be called from the render thread.

◆ url

- (nonnull NSString *) url

Thread-safe.

May be called from any thread


The documentation for this class was generated from the following file: