Interface Effect

All Known Implementing Classes:
Effect.CppProxy

public interface Effect
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(int fxWidth, int fxHeight, int surfaceWidth, int surfaceHeight)
    activate current effect MUST be called from the render thread for OpenGL backends.
    void
    callJsMethod(String methodName, String params)
    Call js method in effect.
    void
    deserialize(String resolvedUrl, String configOverride)
    Deserialize effect from the provided `resoved_url`.
    void
     
    void
    dumpFs(String outDir)
     
     
    void
    evalJs(String script, JsCallback resultCallback)
    Evaluate the `script` in effect.
    Evaluate the `script` in effect.
    void
    Reset effect state MUST be called from the render thread
    If effect is based on Scene engine and it is activated completly - returns Scene object from the effect.
     
    void
    Update effect state (evaluate scheduled JS calls) MUST be called from the render thread
    url()
    Thread-safe.
  • Method Details

    • url

      @NonNull String url()
      Thread-safe. May be called from any thread
    • callJsMethod

      void callJsMethod(@NonNull String methodName, @NonNull String params)
      Call js method in effect.
      Parameters:
      methodName - JS global function name. Member functions are not supported.
      params - Function arguments.
    • evalJs

      void evalJs(@NonNull String script, @Nullable JsCallback resultCallback)
      Evaluate the `script` in effect. This method is thread safe.
      Parameters:
      sctipt - JS string to execute
      js_callback - Callback for result, will be called in render thread.
    • evalJsSync

      @NonNull String evalJsSync(@NonNull String script)
      Evaluate the `script` in effect. MUST be called from the render thread
      Parameters:
      sctipt - JS string to execute
      Returns:
      JS evaluation result
    • reset

      void reset()
      Reset effect state MUST be called from the render thread
    • update

      void update()
      Update effect state (evaluate scheduled JS calls) MUST be called from the render thread
    • scene

      @Nullable Scene 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.
    • deserialize

      void deserialize(@NonNull String resolvedUrl, @NonNull String 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.
    • activate

      void activate(int fxWidth, int fxHeight, int surfaceWidth, int surfaceHeight)
      activate current effect MUST be called from the render thread for OpenGL backends.
    • dumpFs

      void dumpFs(@NonNull String outDir)
    • dump

      void dump()
    • dumpJson

      @NonNull String dumpJson()
    • status

      @NonNull EffectStatus status()