diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-15 18:45:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-15 18:45:49 +0400 |
commit | f04546018f44ccaa038526cefc5fd2a212b2c20d (patch) | |
tree | 5364f988d74f06e745c7b5eced9b5b380e7e7d34 /source/blender/nodes | |
parent | 4f80c3464fab5d79a06ab5b56b2bea6fc72acef7 (diff) |
style cleanup
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_viewer.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_viewer.c b/source/blender/nodes/composite/nodes/node_composite_viewer.c index 1fc9399e876..e97863a9463 100644 --- a/source/blender/nodes/composite/nodes/node_composite_viewer.c +++ b/source/blender/nodes/composite/nodes/node_composite_viewer.c @@ -34,11 +34,11 @@ /* **************** VIEWER ******************** */ -static bNodeSocketTemplate cmp_node_viewer_in[]= { - { SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, - { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, - { SOCK_FLOAT, 1, N_("Z"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, - { -1, 0, "" } +static bNodeSocketTemplate cmp_node_viewer_in[] = { + { SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, + { SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, + { SOCK_FLOAT, 1, N_("Z"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE}, + { -1, 0, "" } }; @@ -47,9 +47,9 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, /* image assigned to output */ /* stack order input sockets: col, alpha, z */ - if (node->id && (node->flag & NODE_DO_OUTPUT)) { /* only one works on out */ - RenderData *rd= data; - Image *ima= (Image *)node->id; + if (node->id && (node->flag & NODE_DO_OUTPUT)) { /* only one works on out */ + RenderData *rd = data; + Image *ima = (Image *)node->id; ImBuf *ibuf; CompBuf *cbuf, *tbuf; int rectx, recty; @@ -58,8 +58,8 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, BKE_image_user_frame_calc(node->storage, rd->cfra, 0); /* always returns for viewer image, but we check nevertheless */ - ibuf= BKE_image_acquire_ibuf(ima, node->storage, &lock); - if (ibuf==NULL) { + ibuf = BKE_image_acquire_ibuf(ima, node->storage, &lock); + if (ibuf == NULL) { printf("node_composit_exec_viewer error\n"); BKE_image_release_ibuf(ima, lock); return; @@ -71,28 +71,28 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, IMB_freezbuffloatImBuf(ibuf); /* get size */ - tbuf= in[0]->data?in[0]->data:(in[1]->data?in[1]->data:in[2]->data); - if (tbuf==NULL) { - rectx= 320; recty= 256; + tbuf = in[0]->data ? in[0]->data : (in[1]->data ? in[1]->data : in[2]->data); + if (tbuf == NULL) { + rectx = 320; recty = 256; } else { - rectx= tbuf->x; - recty= tbuf->y; + rectx = tbuf->x; + recty = tbuf->y; } /* make ibuf, and connect to ima */ - ibuf->x= rectx; - ibuf->y= recty; + ibuf->x = rectx; + ibuf->y = recty; imb_addrectfloatImBuf(ibuf); - ima->ok= IMA_OK_LOADED; + ima->ok = IMA_OK_LOADED; /* now we combine the input with ibuf */ - cbuf= alloc_compbuf(rectx, recty, CB_RGBA, 0); /* no alloc*/ - cbuf->rect= ibuf->rect_float; + cbuf = alloc_compbuf(rectx, recty, CB_RGBA, 0); /* no alloc*/ + cbuf->rect = ibuf->rect_float; /* when no alpha, we can simply copy */ - if (in[1]->data==NULL) { + if (in[1]->data == NULL) { composit1_pixel_processor(node, cbuf, in[0]->data, in[0]->vec, do_copy_rgba, CB_RGBA); } else @@ -100,14 +100,14 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, /* zbuf option */ if (in[2]->data) { - CompBuf *zbuf= alloc_compbuf(rectx, recty, CB_VAL, 1); - ibuf->zbuf_float= zbuf->rect; + CompBuf *zbuf = alloc_compbuf(rectx, recty, CB_VAL, 1); + ibuf->zbuf_float = zbuf->rect; ibuf->mall |= IB_zbuffloat; composit1_pixel_processor(node, zbuf, in[2]->data, in[2]->vec, do_copy_value, CB_VAL); /* free compbuf, but not the rect */ - zbuf->malloc= 0; + zbuf->malloc = 0; free_compbuf(zbuf); } @@ -122,13 +122,13 @@ static void node_composit_exec_viewer(void *data, bNode *node, bNodeStack **in, } } -static void node_composit_init_viewer(bNodeTree *UNUSED(ntree), bNode* node, bNodeTemplate *UNUSED(ntemp)) +static void node_composit_init_viewer(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp)) { - ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); - node->storage= iuser; - iuser->sfra= 1; - iuser->fie_ima= 2; - iuser->ok= 1; + ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "node image user"); + node->storage = iuser; + iuser->sfra = 1; + iuser->fie_ima = 2; + iuser->ok = 1; node->custom3 = 0.5f; node->custom4 = 0.5f; } |