Adiciona registro de formatos no core e tinyblocks-image (ops genericas + Load/Save)
This commit is contained in:
1 parent
fca7aa2f63
commit
f4e2556110
11 files changed
+479
-9
No files matched your search
@@ -231,13 +231,15 @@ static bool ppm_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) {
|
||||
{"r",TB_VALUE_REAL},{"g",TB_VALUE_REAL},{"b",TB_VALUE_REAL}};
|
||||
static const TinyBlocks_SlotDesc getp_in[] = {{"imagem",TB_VALUE_IMAGE},{"x",TB_VALUE_INTEGER},{"y",TB_VALUE_INTEGER}};
|
||||
|
||||
return reg(rt, lib, "PPM.Load", load_in, 1, img_out, 1, eval_load)
|
||||
bool ok = reg(rt, lib, "PPM.Load", load_in, 1, img_out, 1, eval_load)
|
||||
&& reg(rt, lib, "PPM.Save", save_in, 2, NULL, 0, eval_save)
|
||||
&& reg(rt, lib, "PPM.New", new_in, 5, img_out, 1, eval_new)
|
||||
&& reg(rt, lib, "PPM.Width", wh_in, 1, n_out, 1, eval_width)
|
||||
&& reg(rt, lib, "PPM.Height", wh_in, 1, n_out, 1, eval_height)
|
||||
&& reg(rt, lib, "PPM.SetPixel", setp_in, 6, NULL, 0, eval_setpixel)
|
||||
&& reg(rt, lib, "PPM.GetPixel", getp_in, 3, rgb_out, 1, eval_getpixel);
|
||||
if (ok) tb_image_register_format("ppm", tb_ppm_load, tb_ppm_save);
|
||||
return ok;
|
||||
}
|
||||
|
||||
TINYBLOCKS_DEFINE_LIBRARY(ppm, "tinyblocks-ppm", "1.0.0", ppm_init, NULL)
|
||||
|
||||
Reference in new issue
Block a user