diff options
author | Ton Roosendaal <ton@blender.org> | 2006-02-03 23:39:36 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-02-03 23:39:36 +0300 |
commit | 6ac2c83016c4f0cd713e3170ce55f22b5e99707c (patch) | |
tree | eee13b4ae9c0fd4205c6d29b0d3c82b6fed235a8 /source/blender/src | |
parent | 7a7c33ea2713e06c1f9581838a3b2c0e8ce1f48c (diff) |
Redoing the blur filters for composit;
http://www.blender.org/bf/filters/
I found out current blur actually doesn't do gauss, but more did regular
quadratic. Now you can choose common filter types, but more specifically;
- set gamma on, to emphasize bright parts in blur more than darker parts
- use the bokeh option for (current circlular only) blur based on true
area filters (meaning, for each pixel it samples the entire surrounding).
This enables more effects, but is also much slower. Have to check on
optimization for this still... use with care!
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/drawnode.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c index 9dc00c18065..ed8f6d81ba9 100644 --- a/source/blender/src/drawnode.c +++ b/source/blender/src/drawnode.c @@ -699,17 +699,34 @@ static int node_composit_buts_renderresult(uiBlock *block, bNodeTree *ntree, bNo static int node_composit_buts_blur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) { if(block) { + NodeBlurData *nbd= node->storage; uiBut *bt; + short dy= butr->ymin+19; + short dx= (butr->xmax-butr->xmin)/2; + short dx3=(butr->xmax-butr->xmin)/3; + char str[256]; uiBlockBeginAlign(block); + sprintf(str, "Filter Type%%t|Flat %%x%d|Tent %%x%d|Quad %%x%d|Cubic %%x%d|Gauss %%x%d|CatRom %%x%d|Mitch %%x%d", R_FILTER_BOX, R_FILTER_TENT, R_FILTER_QUAD, R_FILTER_CUBIC, R_FILTER_GAUSS, R_FILTER_CATROM, R_FILTER_MITCH); + uiDefButS(block, MENU, B_NODE_EXEC,str, + butr->xmin, dy, dx3, 19, + &nbd->filtertype, 0, 0, 0, 0, "Set sampling filter for blur"); + uiDefButC(block, TOG, B_NODE_EXEC, "Bokeh", + butr->xmin+dx3, dy, dx3, 19, + &nbd->bokeh, 0, 0, 0, 0, "Uses circular filter, warning it's slow!"); + uiDefButC(block, TOG, B_NODE_EXEC, "Gamma", + butr->xmin+2*dx3, dy, dx3, 19, + &nbd->gamma, 0, 0, 0, 0, "Applies filter on gamma corrected values"); + + dy-=19; bt=uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "X:", - butr->xmin, butr->ymin, (butr->xmax-butr->xmin)/2, 19, - &node->custom1, 0, 256, 0, 0, ""); + butr->xmin, dy, dx, 19, + &nbd->sizex, 0, 256, 0, 0, ""); bt=uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Y:", - butr->xmin+(butr->xmax-butr->xmin)/2, butr->ymin, (butr->xmax-butr->xmin)/2, 19, - &node->custom2, 0, 256, 0, 0, ""); + butr->xmin+dx, dy, dx, 19, + &nbd->sizey, 0, 256, 0, 0, ""); } - return 19; + return 38; } static int node_composit_buts_filter(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) |