converted more mixed tab/space indentations to tabs. only whitespace changes.
[blender.git] / source / blender / nodes / intern / CMP_nodes / CMP_image.c
index 1ea3cf9..3caaad2 100644 (file)
@@ -294,12 +294,12 @@ static void node_composit_exec_image(void *data, bNode *node, bNodeStack **UNUSE
 
 static void node_composit_init_image(bNode* node)
 {
-   ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user");
-   node->storage= iuser;
-   iuser->frames= 1;
-   iuser->sfra= 1;
-   iuser->fie_ima= 2;
-   iuser->ok= 1;
+       ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user");
+       node->storage= iuser;
+       iuser->frames= 1;
+       iuser->sfra= 1;
+       iuser->fie_ima= 2;
+       iuser->ok= 1;
 }
 
 void register_node_type_cmp_image(ListBase *lb)
@@ -321,27 +321,27 @@ void register_node_type_cmp_image(ListBase *lb)
 
 static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, int recty, int passcode)
 {
-   float *fp= RE_RenderLayerGetPass(rl, passcode);
-   if(fp) {
-         CompBuf *buf;
-         int buftype= CB_VEC3;
-
-         if(ELEM3(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST))
-                buftype= CB_VAL;
-         else if(passcode==SCE_PASS_VECTOR)
-                buftype= CB_VEC4;
-         else if(ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA))
-                buftype= CB_RGBA;
-
-         if(rd->scemode & R_COMP_CROP)
-                buf= get_cropped_compbuf(&rd->disprect, fp, rectx, recty, buftype);
-         else {
-                buf= alloc_compbuf(rectx, recty, buftype, 0);
-                buf->rect= fp;
-         }
-         return buf;
-   }
-   return NULL;
+       float *fp= RE_RenderLayerGetPass(rl, passcode);
+       if(fp) {
+               CompBuf *buf;
+               int buftype= CB_VEC3;
+
+               if(ELEM3(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST))
+                       buftype= CB_VAL;
+               else if(passcode==SCE_PASS_VECTOR)
+                       buftype= CB_VEC4;
+               else if(ELEM(passcode, SCE_PASS_COMBINED, SCE_PASS_RGBA))
+                       buftype= CB_RGBA;
+
+               if(rd->scemode & R_COMP_CROP)
+                       buf= get_cropped_compbuf(&rd->disprect, fp, rectx, recty, buftype);
+               else {
+                       buf= alloc_compbuf(rectx, recty, buftype, 0);
+                       buf->rect= fp;
+               }
+               return buf;
+       }
+       return NULL;
 }
 
 static void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out, int rectx, int recty)
@@ -383,51 +383,51 @@ static void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStac
 
 static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **UNUSED(in), bNodeStack **out)
 {
-   Scene *sce= (Scene *)node->id;
-   Render *re= (sce)? RE_GetRender(sce->id.name): NULL;
-   RenderData *rd= data;
-   RenderResult *rr= NULL;
-
-   if(re)
-          rr= RE_AcquireResultRead(re);
-
-   if(rr) {
-         SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
-         if(srl) {
-                RenderLayer *rl= RE_GetRenderLayer(rr, srl->name);
-                if(rl && rl->rectf) {
-                       CompBuf *stackbuf;
-
-                       /* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */
-                       if(rd->scemode & R_COMP_CROP)
-                          stackbuf= get_cropped_compbuf(&rd->disprect, rl->rectf, rr->rectx, rr->recty, CB_RGBA);
-                       else {
-                          stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0);
-                          stackbuf->rect= rl->rectf;
-                       }
-                       if(stackbuf==NULL) {
-                          printf("Error; Preview Panel in UV Window returns zero sized image\n");
-                       }
-                       else {
-                          stackbuf->xof= rr->xof;
-                          stackbuf->yof= rr->yof;
+       Scene *sce= (Scene *)node->id;
+       Render *re= (sce)? RE_GetRender(sce->id.name): NULL;
+       RenderData *rd= data;
+       RenderResult *rr= NULL;
+
+       if(re)
+               rr= RE_AcquireResultRead(re);
+
+       if(rr) {
+               SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
+               if(srl) {
+                       RenderLayer *rl= RE_GetRenderLayer(rr, srl->name);
+                       if(rl && rl->rectf) {
+                               CompBuf *stackbuf;
+
+                               /* we put render rect on stack, cbuf knows rect is from other ibuf when freed! */
+                               if(rd->scemode & R_COMP_CROP)
+                                       stackbuf= get_cropped_compbuf(&rd->disprect, rl->rectf, rr->rectx, rr->recty, CB_RGBA);
+                               else {
+                                       stackbuf= alloc_compbuf(rr->rectx, rr->recty, CB_RGBA, 0);
+                                       stackbuf->rect= rl->rectf;
+                               }
+                               if(stackbuf==NULL) {
+                                       printf("Error; Preview Panel in UV Window returns zero sized image\n");
+                               }
+                               else {
+                                       stackbuf->xof= rr->xof;
+                                       stackbuf->yof= rr->yof;
 
-                          /* put on stack */   
-                          out[RRES_OUT_IMAGE]->data= stackbuf;
+                                       /* put on stack */
+                                       out[RRES_OUT_IMAGE]->data= stackbuf;
 
-                          if(out[RRES_OUT_ALPHA]->hasoutput)
-                                 out[RRES_OUT_ALPHA]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
+                                       if(out[RRES_OUT_ALPHA]->hasoutput)
+                                               out[RRES_OUT_ALPHA]->data= valbuf_from_rgbabuf(stackbuf, CHAN_A);
 
-                          node_composit_rlayers_out(rd, rl, out, rr->rectx, rr->recty);
+                                       node_composit_rlayers_out(rd, rl, out, rr->rectx, rr->recty);
 
-                          generate_preview(data, node, stackbuf);
+                                       generate_preview(data, node, stackbuf);
+                               }
                        }
-                }
-         }
-   }
+               }
+       }
 
-   if(re)
-          RE_ReleaseResult(re);
+       if(re)
+               RE_ReleaseResult(re);
 }