Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 9 Oct 2011 20:28:35 +0000 (20:28 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 9 Oct 2011 20:28:35 +0000 (20:28 +0000)
===========================

Scale compositor node feature: if there's no input and scaling is set to
absolute, generate image with given resolution using color from input
socket as background. Useful to generate "overscanned" foortage.

source/blender/nodes/composite/nodes/node_composite_scale.c

index 67d5108b59087f30166f6d972f8a0d7b216f0ecc..55d080058e40ebee9e3a0a0b372f0391c725384f 100644 (file)
@@ -110,6 +110,25 @@ static void node_composit_exec_scale(void *data, bNode *node, bNodeStack **in, b
                if(cbuf!=in[0]->data)
                        free_compbuf(cbuf);
        }
+       else if (node->custom1==CMP_SCALE_ABSOLUTE) {
+               CompBuf *stackbuf;
+               int a, x, y;
+               float *fp;
+
+               x = MAX2((int)in[1]->vec[0], 1);
+               y = MAX2((int)in[2]->vec[0], 1);
+
+               stackbuf = alloc_compbuf(x, y, CB_RGBA, 1);
+               fp = stackbuf->rect;
+
+               a = stackbuf->x * stackbuf->y;
+               while(a--) {
+                       copy_v4_v4(fp, in[0]->vec);
+                       fp += 4;
+               }
+
+               out[0]->data= stackbuf;
+       }
 }
 
 void register_node_type_cmp_scale(ListBase *lb)