diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-05-24 18:01:00 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-05-24 18:01:00 +0400 |
commit | 3305674bb5615b959bc5dfa73dab7e9783849081 (patch) | |
tree | a4ebbc329a9b2581fe5b1c14f0436e6402a3a98c /source/blender/nodes | |
parent | 3e1df2d12ebb319c0d12d2511d1a728667b5e45e (diff) |
Port mask node to new compositor system
Works in the same way as double edge node -- not actually multithreaded
but currently it's fast enough to be used in such way. In the future it
might be changed in some way.
Move actual mask rasterization code to BKE so it's resued by old compositor
system and new compositor. Also in the future it might be used to display
mask preview in mask editor.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_mask.c | 40 |
2 files changed, 1 insertions, 40 deletions
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 358abb08ba4..5e36f90f217 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -35,7 +35,6 @@ set(INC ../makesrna ../render/extern/include ../../../intern/guardedalloc - ../../../intern/raskter ../compositor ) diff --git a/source/blender/nodes/composite/nodes/node_composite_mask.c b/source/blender/nodes/composite/nodes/node_composite_mask.c index 93d1edd76e8..c90c7918660 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mask.c +++ b/source/blender/nodes/composite/nodes/node_composite_mask.c @@ -36,8 +36,6 @@ #include "BKE_mask.h" -// XXX: ... -#include "../../../../intern/raskter/raskter.h" #include "node_composite_util.h" /* **************** Translate ******************** */ @@ -58,7 +56,6 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) Mask *mask = (Mask *)node->id; CompBuf *stackbuf; RenderData *rd = data; - MaskObject *maskobj = mask->maskobjs.first; float *res; int sx, sy; @@ -84,42 +81,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) stackbuf = alloc_compbuf(sx, sy, CB_VAL, TRUE); res = stackbuf->rect; - for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) { - MaskSpline *spline; - - for (spline = maskobj->splines.first; spline; spline = spline->next) { - float *diff_points; - int tot_diff_point; - - diff_points = BKE_mask_spline_differentiate(spline, &tot_diff_point); - - /* TODO, make this optional! */ - if (sx != sy) { - float *fp; - int i; - float asp; - - if (sx < sy) { - fp = &diff_points[0]; - asp = (float)sx / (float)sy; - } - else { - fp = &diff_points[1]; - asp = (float)sy / (float)sx; - } - - for (i = 0; i < tot_diff_point; i++, fp += 2) { - (*fp) = (((*fp) - 0.5f) / asp) + 0.5f; - } - } - - if (tot_diff_point) { - PLX_raskterize(diff_points, tot_diff_point, res, sx, sy); - - MEM_freeN(diff_points); - } - } - } + BKE_mask_rasterize(mask, sx, sy, res); /* pass on output and free */ out[0]->data = stackbuf; |