diff options
author | Robert Holcomb <bob_holcomb@hotmail.com> | 2009-09-10 08:12:22 +0400 |
---|---|---|
committer | Robert Holcomb <bob_holcomb@hotmail.com> | 2009-09-10 08:12:22 +0400 |
commit | fa4ee2be849b6236d61e482106ed9e20f20f21de (patch) | |
tree | 9c1980eb115d6982da2b321f15b06f4c38dea62c /source/blender/nodes/intern/CMP_util.c | |
parent | dac27004b863da96c57b071fc0479680e06a9725 (diff) |
Added Levels Node (histogram, with mean/std deviation outputs)
Added RGB space distance matte Node
Added HSV color matte Node
Fixed Image difference matte Node to use image differences instead of RGB space distance
Fixed luminance node for low end values being read wrong
Fixed CMP_util copy/swap functions not accounting for all channels
Fixed UI for difference matte Node
Added RNA for new nodes
Diffstat (limited to 'source/blender/nodes/intern/CMP_util.c')
-rw-r--r-- | source/blender/nodes/intern/CMP_util.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/source/blender/nodes/intern/CMP_util.c b/source/blender/nodes/intern/CMP_util.c index f9805645115..b396d5549d7 100644 --- a/source/blender/nodes/intern/CMP_util.c +++ b/source/blender/nodes/intern/CMP_util.c @@ -1104,9 +1104,23 @@ void qd_getPixel(CompBuf* src, int x, int y, float* col) { if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) { float* bc = &src->rect[(x + y*src->x)*src->type]; - col[0] = bc[0], col[1] = bc[1], col[2] = bc[2]; + switch(src->type){ + /* these fallthrough to get all the channels */ + case CB_RGBA: col[3]=bc[3]; + case CB_VEC3: col[2]=bc[2]; + case CB_VEC2: col[1]=bc[1]; + case CB_VAL: col[0]=bc[0]; + } + } + else { + switch(src->type){ + /* these fallthrough to get all the channels */ + case CB_RGBA: col[3]=0.0; + case CB_VEC3: col[2]=0.0; + case CB_VEC2: col[1]=0.0; + case CB_VAL: col[0]=0.0; + } } - else col[0] = col[1] = col[2] = 0.f; } // sets pixel (x, y) to color col @@ -1114,7 +1128,13 @@ void qd_setPixel(CompBuf* src, int x, int y, float* col) { if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) { float* bc = &src->rect[(x + y*src->x)*src->type]; - bc[0] = col[0], bc[1] = col[1], bc[2] = col[2]; + switch(src->type){ + /* these fallthrough to get all the channels */ + case CB_RGBA: bc[3]=col[3]; + case CB_VEC3: bc[2]=col[2]; + case CB_VEC2: bc[1]=col[1]; + case CB_VAL: bc[0]=col[0]; + } } } |