10#include "bnb/scene/interfaces/scene.hpp"
11#include <bnb/utils/defs.hpp>
16namespace bnb {
namespace interfaces {
19enum class effect_status;
26 virtual std::string
url() = 0;
34 virtual void call_js_method(
const std::string & method_name,
const std::string & params) = 0;
41 virtual void eval_js(
const std::string & script,
const std::shared_ptr<js_callback> & result_callback) = 0;
69 virtual std::shared_ptr<::bnb::interfaces::scene>
scene() = 0;
78 virtual void deserialize(
const std::string & resolved_url,
const std::string & config_override) = 0;
84 virtual void activate(int32_t fx_width, int32_t fx_height, int32_t surface_width, int32_t surface_height) = 0;
86 virtual void dump_fs(
const std::string & out_dir) = 0;
88 virtual void dump() = 0;
90 virtual std::string dump_json() = 0;
92 virtual effect_status status() = 0;
virtual void reset()=0
Reset effect state MUST be called from the render thread.
virtual std::string url()=0
Thread-safe.
virtual void eval_js(const std::string &script, const std::shared_ptr< js_callback > &result_callback)=0
Evaluate the script in effect.
virtual void activate(int32_t fx_width, int32_t fx_height, int32_t surface_width, int32_t surface_height)=0
activate current effect MUST be called from the render thread for OpenGL backends.
virtual void deserialize(const std::string &resolved_url, const std::string &config_override)=0
Deserialize effect from the provided resoved_url.
virtual void call_js_method(const std::string &method_name, const std::string ¶ms)=0
Call js method in effect.
virtual std::shared_ptr<::bnb::interfaces::scene > scene()=0
If effect is based on Scene engine and it is activated completly - returns Scene object from the effe...
virtual std::string eval_js_sync(const std::string &script)=0
Evaluate the script in effect.
virtual void update()=0
Update effect state (evaluate scheduled JS calls) MUST be called from the render thread.