10#include <bnb/utils/defs.hpp>
15namespace bnb {
namespace interfaces {
18enum class effect_status;
25 virtual std::string
url() = 0;
27 virtual std::string name() = 0;
35 virtual void call_js_method(
const std::string & method_name,
const std::string & params) = 0;
42 virtual void eval_js(
const std::string & script,
const std::shared_ptr<js_callback> & result_callback) = 0;
71 virtual void deserialize(
const std::string & resolved_url,
const std::string & config_override) = 0;
77 virtual void activate(int32_t fx_width, int32_t fx_height, int32_t surface_width, int32_t surface_height) = 0;
79 virtual effect_status status() = 0;
81 virtual int64_t get_native_context() = 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::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.