Files
armorpaint/lab/plugins/plugins.c
T

27 lines
649 B
C
Raw Normal View History

2023-02-08 17:15:19 +01:00
2025-02-27 16:12:24 +01:00
#include "../../../base/plugins/plugin_api.h"
2024-08-31 17:24:01 +02:00
#include "iron_array.h"
2024-10-26 15:17:05 +02:00
#include "proc_texsynth/proc_texsynth.h"
2023-02-08 17:15:19 +01:00
2024-08-31 17:24:01 +02:00
FN(texsynth_inpaint) {
int32_t w;
JS_ToInt32(ctx, &w, argv[0]);
int32_t h;
JS_ToInt32(ctx, &h, argv[1]);
size_t size;
void *out = JS_GetArrayBuffer(ctx, &size, argv[2]);
void *img = JS_GetArrayBuffer(ctx, &size, argv[3]);
void *mask = JS_GetArrayBuffer(ctx, &size, argv[4]);
bool tiling = JS_ToBool(ctx, argv[5]);
texsynth_inpaint(w, h, out, img, mask, tiling);
2025-02-06 21:37:24 +01:00
return JS_UNDEFINED;
2023-02-08 17:15:19 +01:00
}
2024-08-30 21:02:15 +02:00
void plugin_embed() {
JSValue global_obj = JS_GetGlobalObject(js_ctx);
2024-08-31 17:24:01 +02:00
BIND(texsynth_inpaint, 6);
2024-08-30 21:02:15 +02:00
JS_FreeValue(js_ctx, global_obj);
}