plugins.c 649 B

1234567891011121314151617181920212223242526
  1. #include "../../../base/sources/plugin_api.h"
  2. #include "iron_array.h"
  3. #include "proc_texsynth/proc_texsynth.h"
  4. FN(texsynth_inpaint) {
  5. int32_t w;
  6. JS_ToInt32(ctx, &w, argv[0]);
  7. int32_t h;
  8. JS_ToInt32(ctx, &h, argv[1]);
  9. size_t size;
  10. void *out = JS_GetArrayBuffer(ctx, &size, argv[2]);
  11. void *img = JS_GetArrayBuffer(ctx, &size, argv[3]);
  12. void *mask = JS_GetArrayBuffer(ctx, &size, argv[4]);
  13. bool tiling = JS_ToBool(ctx, argv[5]);
  14. texsynth_inpaint(w, h, out, img, mask, tiling);
  15. return JS_UNDEFINED;
  16. }
  17. void plugin_embed() {
  18. JSValue global_obj = JS_GetGlobalObject(js_ctx);
  19. BIND(texsynth_inpaint, 6);
  20. JS_FreeValue(js_ctx, global_obj);
  21. }