cuticle/hi/test.c

43 lines
1.2 KiB
C
Raw Normal View History

2024-06-26 20:47:26 +03:00
#include"node.h"
#include<vips/vips.h>
int main() {
VIPS_INIT("Cuticle Test");
CHiPubNode *noed0 = CHi_ConstantSample();
noed0->values[0].type = CUTIHI_VAL_VEC4;
noed0->values[0].vec4[0] = 255;
noed0->values[0].vec4[1] = 0;
noed0->values[0].vec4[2] = 0;
noed0->values[0].vec4[3] = 255;
CHiPubNode *noed1 = CHi_ConstantSample();
noed1->values[0].type = CUTIHI_VAL_VEC4;
noed1->values[0].vec4[0] = 0;
noed1->values[0].vec4[1] = 0;
noed1->values[0].vec4[2] = 255;
noed1->values[0].vec4[3] = 0;
CHiPubNode *noed2 = CHi_Embed();
noed2->values[1].type = CUTIHI_VAL_LINKED;
noed2->values[1].linked.to = noed0;
noed2->values[1].linked.idx = 1;
noed2->values[2].type = CUTIHI_VAL_VEC4;
noed2->values[2].vec4[0] = 0;
noed2->values[2].vec4[1] = 0;
noed2->values[2].vec4[2] = 1;
noed2->values[2].vec4[3] = 1;
noed2->values[3].type = CUTIHI_VAL_LINKED;
noed2->values[3].linked.to = noed1;
noed2->values[3].linked.idx = 1;
noed2->values[4].type = CUTIHI_VAL_VEC4;
noed2->values[4].vec4[0] = 0;
noed2->values[4].vec4[1] = 0;
noed2->values[4].vec4[2] = 1;
noed2->values[4].vec4[3] = 1;
noed2->Perform(noed2);
vips_pngsave((VipsImage*) noed2->values[0].sample, "test.png", NULL);
}