Blender V2.61 - r43446
|
#include "node_composite_util.h"
Go to the source code of this file.
Classes | |
struct | BokehCoeffs |
Defines | |
#define | YVV(L) |
#define | TESTBG1(c, w) |
#define | TESTBG4(c, w) |
#define | AAPIX(a, b) |
#define | CSCAN(a, b) |
Typedefs | |
typedef struct BokehCoeffs | BokehCoeffs |
Functions | |
static void | makeBokeh (char bktype, char ro, int *len_bkh, float *inradsq, BokehCoeffs BKH[8], float bkh_b[4]) |
static float | getWeight (BokehCoeffs *BKH, int len_bkh, float u, float v, float rad, float inradsq) |
static float | RI_vdC (unsigned int bits, unsigned int r) |
static void | IIR_gauss_single (CompBuf *buf, float sigma) |
static void | defocus_blur (bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, float inpval, int no_zbuf) |
static void | node_composit_exec_defocus (void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out) |
static void | node_composit_init_defocus (bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp)) |
void | register_node_type_cmp_defocus (bNodeTreeType *ttype) |
Variables | |
static bNodeSocketTemplate | cmp_node_defocus_in [] |
static bNodeSocketTemplate | cmp_node_defocus_out [] |
Definition in file node_composite_defocus.c.
#define AAPIX | ( | a, | |
b | |||
) |
#define CSCAN | ( | a, | |
b | |||
) |
{\ int _ny = y + b;\ if ((_ny >= 0) && (_ny < new->y)) {\ xs = x - a + 1;\ if (xs < 0) xs = 0;\ xe = x + a;\ if (xe > new->x) xe = new->x;\ p = _ny*new->x + xs;\ if (new->type==CB_VAL) {\ for (_x=xs; _x<xe; _x++, p++) TESTBG1(wtcol, wt);\ }\ else {\ p4 = p * new->type;\ for (_x=xs; _x<xe; _x++, p++, p4+=new->type) TESTBG4(wtcol, wt);\ }\ }\ }
Referenced by defocus_blur().
#define TESTBG1 | ( | c, | |
w | |||
) |
#define TESTBG4 | ( | c, | |
w | |||
) |
{\ if (ct_crad > nqd->bthresh) {\ if (crad->rect[p] > nqd->bthresh) {\ new->rect[p4] += c[0];\ new->rect[p4+1] += c[1];\ new->rect[p4+2] += c[2];\ new->rect[p4+3] += c[3];\ wts->rect[p] += w;\ }\ }\ else {\ new->rect[p4] += c[0];\ new->rect[p4+1] += c[1];\ new->rect[p4+2] += c[2];\ new->rect[p4+3] += c[3];\ wts->rect[p] += w;\ }\ }
Referenced by defocus_blur().
#define YVV | ( | L | ) |
{\ W[0] = cf[0]*X[0] + cf[1]*X[0] + cf[2]*X[0] + cf[3]*X[0];\ W[1] = cf[0]*X[1] + cf[1]*W[0] + cf[2]*X[0] + cf[3]*X[0];\ W[2] = cf[0]*X[2] + cf[1]*W[1] + cf[2]*W[0] + cf[3]*X[0];\ for (i=3; i<L; i++)\ W[i] = cf[0]*X[i] + cf[1]*W[i-1] + cf[2]*W[i-2] + cf[3]*W[i-3];\ tsu[0] = W[L-1] - X[L-1];\ tsu[1] = W[L-2] - X[L-1];\ tsu[2] = W[L-3] - X[L-1];\ tsv[0] = tsM[0]*tsu[0] + tsM[1]*tsu[1] + tsM[2]*tsu[2] + X[L-1];\ tsv[1] = tsM[3]*tsu[0] + tsM[4]*tsu[1] + tsM[5]*tsu[2] + X[L-1];\ tsv[2] = tsM[6]*tsu[0] + tsM[7]*tsu[1] + tsM[8]*tsu[2] + X[L-1];\ Y[L-1] = cf[0]*W[L-1] + cf[1]*tsv[0] + cf[2]*tsv[1] + cf[3]*tsv[2];\ Y[L-2] = cf[0]*W[L-2] + cf[1]*Y[L-1] + cf[2]*tsv[0] + cf[3]*tsv[1];\ Y[L-3] = cf[0]*W[L-3] + cf[1]*Y[L-2] + cf[2]*Y[L-1] + cf[3]*tsv[0];\ for (i=L-4; i>=0; i--)\ Y[i] = cf[0]*W[i] + cf[1]*Y[i+1] + cf[2]*Y[i+2] + cf[3]*Y[i+3];\ }
typedef struct BokehCoeffs BokehCoeffs |
static void defocus_blur | ( | bNode * | node, |
CompBuf * | new, | ||
CompBuf * | img, | ||
CompBuf * | zbuf, | ||
float | inpval, | ||
int | no_zbuf | ||
) | [static] |
Definition at line 243 of file node_composite_defocus.c.
References AAPIX, alloc_compbuf(), NodeDefocus::bktype, BLI_frand(), BLI_rand(), NodeDefocus::bthresh, Scene::camera, CB_VAL, CSCAN, credits_svn_gen::e, bNode::exec, KDL::exp(), fabs(), fabsf, floorf, free_compbuf(), NodeDefocus::fstop, G, getWeight(), i, bNode::id, IIR_gauss_single(), Camera::lens, BokehCoeffs::ls_x, BokehCoeffs::ls_y, M_PI, makeBokeh(), MAX2, NodeDefocus::maxblur, MIN2, BokehCoeffs::min_x, BokehCoeffs::min_y, NODE_BREAK, NULL, OB_CAMERA, object_camera_dof_distance(), p, NodeDefocus::preview, CompBuf::rect, RI_vdC(), NodeDefocus::rotation, NodeDefocus::samples, NodeDefocus::scale, sin(), sqrt(), bNode::storage, T, TESTBG1, TESTBG4, CompBuf::type, CompBuf::x, BokehCoeffs::x0, CompBuf::y, and BokehCoeffs::y0.
Referenced by node_composit_exec_defocus().
static float getWeight | ( | BokehCoeffs * | BKH, |
int | len_bkh, | ||
float | u, | ||
float | v, | ||
float | rad, | ||
float | inradsq | ||
) | [static] |
Definition at line 114 of file node_composite_defocus.c.
References BokehCoeffs::dx, BokehCoeffs::dy, BokehCoeffs::x0, and BokehCoeffs::y0.
Referenced by defocus_blur().
static void IIR_gauss_single | ( | CompBuf * | buf, |
float | sigma | ||
) | [static] |
Definition at line 151 of file node_composite_defocus.c.
References CB_VAL, i, MAX2, MEM_callocN(), MEM_freeN(), CompBuf::rect, CompBuf::type, CompBuf::x, X, CompBuf::y, and YVV.
Referenced by defocus_blur().
static void makeBokeh | ( | char | bktype, |
char | ro, | ||
int * | len_bkh, | ||
float * | inradsq, | ||
BokehCoeffs | BKH[8], | ||
float | bkh_b[4] | ||
) | [static] |
Definition at line 58 of file node_composite_defocus.c.
References cos(), DEG2RADF, BokehCoeffs::dx, BokehCoeffs::dy, credits_svn_gen::e, i, BokehCoeffs::ls_x, BokehCoeffs::ls_y, MAX2, BokehCoeffs::max_x, BokehCoeffs::max_y, MIN2, BokehCoeffs::min_x, BokehCoeffs::min_y, sin(), sqrtf, simple_enum_gen::w, BokehCoeffs::x0, and BokehCoeffs::y0.
Referenced by defocus_blur().
static void node_composit_exec_defocus | ( | void * | UNUSEDdata, |
bNode * | node, | ||
bNodeStack ** | in, | ||
bNodeStack ** | out | ||
) | [static] |
Definition at line 806 of file node_composite_defocus.c.
References alloc_compbuf(), CB_RGBA, CB_VAL, bNodeStack::data, defocus_blur(), dupalloc_compbuf(), bNode::exec, free_compbuf(), NodeDefocus::fstop, NodeDefocus::gamco, gamma_correct_compbuf(), NodeDefocus::no_zbuf, NODE_BREAK, NULL, pass_on_compbuf(), premul_compbuf(), NodeDefocus::scale, bNode::storage, CompBuf::type, typecheck_compbuf(), CompBuf::x, and CompBuf::y.
Referenced by register_node_type_cmp_defocus().
static void node_composit_init_defocus | ( | bNodeTree * | UNUSEDntree, |
bNode * | node, | ||
bNodeTemplate * | UNUSEDntemp | ||
) | [static] |
Definition at line 861 of file node_composite_defocus.c.
References NodeDefocus::bktype, NodeDefocus::bthresh, NodeDefocus::fstop, NodeDefocus::gamco, NodeDefocus::maxblur, MEM_callocN(), NodeDefocus::no_zbuf, NodeDefocus::preview, NodeDefocus::rotation, NodeDefocus::samples, NodeDefocus::scale, and bNode::storage.
Referenced by register_node_type_cmp_defocus().
void register_node_type_cmp_defocus | ( | bNodeTreeType * | ttype | ) |
Definition at line 878 of file node_composite_defocus.c.
References CMP_NODE_DEFOCUS, NODE_CLASS_OP_FILTER, node_composit_exec_defocus(), node_composit_init_defocus(), node_copy_standard_storage(), node_free_standard_storage(), NODE_OPTIONS, node_type_base(), node_type_exec(), node_type_init(), node_type_size(), node_type_socket_templates(), node_type_storage(), and nodeRegisterType().
Referenced by registerCompositNodes().
static float RI_vdC | ( | unsigned int | bits, |
unsigned int | r | ||
) | [static] |
Definition at line 136 of file node_composite_defocus.c.
Referenced by defocus_blur().
bNodeSocketTemplate cmp_node_defocus_in[] [static] |
{ { SOCK_RGBA, 1, "Image", 1.0f, 1.0f, 1.0f, 1.0f}, { SOCK_FLOAT, 1, "Z", 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR}, { -1, 0, "" } }
Definition at line 36 of file node_composite_defocus.c.
bNodeSocketTemplate cmp_node_defocus_out[] [static] |
{ { SOCK_RGBA, 0, "Image"}, { -1, 0, "" } }
Definition at line 41 of file node_composite_defocus.c.