Blender V2.61 - r43446
Defines | Typedefs | Functions

node_composite_util.c File Reference

#include "node_composite_util.h"

Go to the source code of this file.

Defines

#define pred(k)   (((k & Nym) << Mx) + (k >> My))
#define YVV(L)

Typedefs

typedef float fREAL

Functions

CompBufalloc_compbuf (int sizex, int sizey, int type, int alloc)
CompBufdupalloc_compbuf (CompBuf *cbuf)
CompBufpass_on_compbuf (CompBuf *cbuf)
void free_compbuf (CompBuf *cbuf)
void print_compbuf (char *str, CompBuf *cbuf)
void compbuf_set_node (CompBuf *cbuf, bNode *node)
void node_compo_pass_on (void *UNUSED(data), int UNUSED(thread), struct bNode *node, void *UNUSED(nodedata), struct bNodeStack **in, struct bNodeStack **out)
CompBufget_cropped_compbuf (rcti *drect, float *rectf, int rectx, int recty, int type)
CompBufscalefast_compbuf (CompBuf *inbuf, int newx, int newy)
void typecheck_compbuf_color (float *out, float *in, int outtype, int intype)
CompBuftypecheck_compbuf (CompBuf *inbuf, int type)
float * compbuf_get_pixel (CompBuf *cbuf, float *defcol, float *use, int x, int y, int xrad, int yrad)
static CompBufcomposit_check_compbuf (CompBuf *cbuf, int type, CompBuf *outbuf)
void composit1_pixel_processor (bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col, void(*func)(bNode *, float *, float *), int src_type)
void composit2_pixel_processor (bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col, CompBuf *fac_buf, float *fac, void(*func)(bNode *, float *, float *, float *), int src_type, int fac_type)
void composit3_pixel_processor (bNode *node, CompBuf *out, CompBuf *src1_buf, float *src1_col, CompBuf *src2_buf, float *src2_col, CompBuf *fac_buf, float *fac, void(*func)(bNode *, float *, float *, float *, float *), int src1_type, int src2_type, int fac_type)
void composit4_pixel_processor (bNode *node, CompBuf *out, CompBuf *src1_buf, float *src1_col, CompBuf *fac1_buf, float *fac1, CompBuf *src2_buf, float *src2_col, CompBuf *fac2_buf, float *fac2, void(*func)(bNode *, float *, float *, float *, float *, float *), int src1_type, int fac1_type, int src2_type, int fac2_type)
CompBufvalbuf_from_rgbabuf (CompBuf *cbuf, int channel)
static CompBufgenerate_procedural_preview (CompBuf *cbuf, int newx, int newy)
void generate_preview (void *data, bNode *node, CompBuf *stackbuf)
void do_rgba_to_yuva (bNode *UNUSED(node), float *out, float *in)
void do_rgba_to_hsva (bNode *UNUSED(node), float *out, float *in)
void do_rgba_to_ycca (bNode *UNUSED(node), float *out, float *in)
void do_yuva_to_rgba (bNode *UNUSED(node), float *out, float *in)
void do_hsva_to_rgba (bNode *UNUSED(node), float *out, float *in)
void do_ycca_to_rgba (bNode *UNUSED(node), float *out, float *in)
void do_copy_rgba (bNode *UNUSED(node), float *out, float *in)
void do_copy_rgb (bNode *UNUSED(node), float *out, float *in)
void do_copy_value (bNode *UNUSED(node), float *out, float *in)
void do_copy_a_rgba (bNode *UNUSED(node), float *out, float *in, float *fac)
void gamma_correct_compbuf (CompBuf *img, int inversed)
void premul_compbuf (CompBuf *img, int inversed)
static unsigned int nextPow2 (unsigned int x, unsigned int *L2)
static unsigned int revbin_upd (unsigned int r, unsigned int h)
static void FHT (fREAL *data, unsigned int M, unsigned int inverse)
static void FHT2D (fREAL *data, unsigned int Mx, unsigned int My, unsigned int nzp, unsigned int inverse)
static void fht_convolve (fREAL *d1, fREAL *d2, unsigned int M, unsigned int N)
void convolve (CompBuf *dst, CompBuf *in1, CompBuf *in2)
void qd_getPixel (CompBuf *src, int x, int y, float *col)
void qd_setPixel (CompBuf *src, int x, int y, float *col)
void qd_addPixel (CompBuf *src, int x, int y, float *col)
void qd_multPixel (CompBuf *src, int x, int y, float f)
void qd_getPixelLerpWrap (CompBuf *src, float u, float v, float *col)
void qd_getPixelLerp (CompBuf *src, float u, float v, float *col)
void qd_getPixelLerpChan (CompBuf *src, float u, float v, int chan, float *out)
CompBufqd_downScaledCopy (CompBuf *src, int scale)
void IIR_gauss (CompBuf *src, float sigma, int chan, int xy)

Detailed Description

Definition in file node_composite_util.c.


Define Documentation

#define pred (   k)    (((k & Nym) << Mx) + (k >> My))

Referenced by FHT2D().

#define YVV (   L)
Value:
{                                                                             \
    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];       \
}

Referenced by IIR_gauss(), and IIR_gauss_single().


Typedef Documentation

typedef float fREAL

Definition at line 790 of file node_composite_util.c.


Function Documentation

CompBuf* alloc_compbuf ( int  sizex,
int  sizey,
int  type,
int  alloc 
)

Definition at line 35 of file node_composite_util.c.

References CB_RGBA, CB_VEC2, CB_VEC3, CompBuf::disprect, CompBuf::malloc, MEM_callocN(), MEM_mapallocN(), CompBuf::rect, CompBuf::type, CompBuf::x, rcti::xmax, rcti::xmin, CompBuf::xrad, CompBuf::y, rcti::ymax, rcti::ymin, and CompBuf::yrad.

Referenced by bloom_with_reference(), blur_single_image(), blur_with_reference(), compbuf_from_pass(), convolve(), defocus_blur(), dupalloc_compbuf(), exec(), fglow(), generate_procedural_preview(), get_cropped_compbuf(), node_composit_exec_alphaover(), node_composit_exec_bilateralblur(), node_composit_exec_blur(), node_composit_exec_color_spill(), node_composit_exec_colorbalance(), node_composit_exec_combhsva(), node_composit_exec_combrgba(), node_composit_exec_combycca(), node_composit_exec_combyuva(), node_composit_exec_composite(), node_composit_exec_crop(), node_composit_exec_curve_rgb(), node_composit_exec_defocus(), node_composit_exec_displace(), node_composit_exec_doubleedgemask(), node_composit_exec_filter(), node_composit_exec_flip(), node_composit_exec_gamma(), node_composit_exec_huecorrect(), node_composit_exec_idmask(), node_composit_exec_invert(), node_composit_exec_lensdist(), node_composit_exec_map_value(), node_composit_exec_mapuv(), node_composit_exec_math(), node_composit_exec_mix_rgb(), node_composit_exec_normal(), node_composit_exec_normalize(), node_composit_exec_rgbtobw(), node_composit_exec_rlayers(), node_composit_exec_rotate(), node_composit_exec_scale(), node_composit_exec_setalpha(), node_composit_exec_splitviewer(), node_composit_exec_texture(), node_composit_exec_valtorgb(), node_composit_exec_view_levels(), node_composit_exec_viewer(), node_composit_exec_zcombine(), node_composit_get_image(), node_composit_get_movieclip(), node_composit_get_zimage(), node_composit_transform(), pass_on_compbuf(), qd_downScaledCopy(), scalefast_compbuf(), streaks(), typecheck_compbuf(), and valbuf_from_rgbabuf().

float* compbuf_get_pixel ( CompBuf cbuf,
float *  defcol,
float *  use,
int  x,
int  y,
int  xrad,
int  yrad 
)
void compbuf_set_node ( CompBuf cbuf,
bNode node 
)

Definition at line 128 of file node_composite_util.c.

References CompBuf::node.

Referenced by local_merge(), and localize().

void composit1_pixel_processor ( bNode node,
CompBuf out,
CompBuf src_buf,
float *  src_col,
void(*)(bNode *, float *, float *)  func,
int  src_type 
)
void composit2_pixel_processor ( bNode node,
CompBuf out,
CompBuf src_buf,
float *  src_col,
CompBuf fac_buf,
float *  fac,
void(*)(bNode *, float *, float *, float *)  func,
int  src_type,
int  fac_type 
)
void composit3_pixel_processor ( bNode node,
CompBuf out,
CompBuf src1_buf,
float *  src1_col,
CompBuf src2_buf,
float *  src2_col,
CompBuf fac_buf,
float *  fac,
void(*)(bNode *, float *, float *, float *, float *)  func,
int  src1_type,
int  src2_type,
int  fac_type 
)
void composit4_pixel_processor ( bNode node,
CompBuf out,
CompBuf src1_buf,
float *  src1_col,
CompBuf fac1_buf,
float *  fac1,
CompBuf src2_buf,
float *  src2_col,
CompBuf fac2_buf,
float *  fac2,
void(*)(bNode *, float *, float *, float *, float *, float *)  func,
int  src1_type,
int  fac1_type,
int  src2_type,
int  fac2_type 
)
static CompBuf* composit_check_compbuf ( CompBuf cbuf,
int  type,
CompBuf outbuf 
) [static]
void convolve ( CompBuf dst,
CompBuf in1,
CompBuf in2 
)
void do_copy_a_rgba ( bNode UNUSEDnode,
float *  out,
float *  in,
float *  fac 
)
void do_copy_rgb ( bNode UNUSEDnode,
float *  out,
float *  in 
)

Definition at line 711 of file node_composite_util.c.

References copy_v3_v3().

Referenced by node_composit_exec_setalpha().

void do_copy_rgba ( bNode UNUSEDnode,
float *  out,
float *  in 
)
void do_copy_value ( bNode UNUSEDnode,
float *  out,
float *  in 
)
void do_hsva_to_rgba ( bNode UNUSEDnode,
float *  out,
float *  in 
)
void do_rgba_to_hsva ( bNode UNUSEDnode,
float *  out,
float *  in 
)
void do_rgba_to_ycca ( bNode UNUSEDnode,
float *  out,
float *  in 
)

Definition at line 682 of file node_composite_util.c.

References BLI_YCC_ITU_BT601, and rgb_to_ycc().

void do_rgba_to_yuva ( bNode UNUSEDnode,
float *  out,
float *  in 
)
void do_ycca_to_rgba ( bNode UNUSEDnode,
float *  out,
float *  in 
)

Definition at line 700 of file node_composite_util.c.

References BLI_YCC_ITU_BT601, and ycc_to_rgb().

void do_yuva_to_rgba ( bNode UNUSEDnode,
float *  out,
float *  in 
)
CompBuf* dupalloc_compbuf ( CompBuf cbuf)
static void FHT ( fREAL data,
unsigned int  M,
unsigned int  inverse 
) [static]

Definition at line 813 of file node_composite_util.c.

References cos(), i, len(), M, M_PI, revbin_upd(), and sqrt().

Referenced by FHT2D().

static void FHT2D ( fREAL data,
unsigned int  Mx,
unsigned int  My,
unsigned int  nzp,
unsigned int  inverse 
) [static]

Definition at line 885 of file node_composite_util.c.

References A, B, C, D(), FHT(), i, and pred.

Referenced by convolve().

static void fht_convolve ( fREAL d1,
fREAL d2,
unsigned int  M,
unsigned int  N 
) [static]

Definition at line 951 of file node_composite_util.c.

References i, L, M, and N.

Referenced by convolve().

void free_compbuf ( CompBuf cbuf)

Definition at line 99 of file node_composite_util.c.

References CompBuf::malloc, MEM_freeN(), CompBuf::next, CompBuf::prev, and CompBuf::rect.

Referenced by bloom_with_reference(), blur_single_image(), blur_with_reference(), composit1_pixel_processor(), composit2_pixel_processor(), composit3_pixel_processor(), composit4_pixel_processor(), convolve(), dblur(), defocus_blur(), exec(), fglow(), free_node_cache(), freeExecutableNode(), generate_preview(), ghosts(), group_free_internal(), lensDistort(), node_composit_exec_bilateralblur(), node_composit_exec_blur(), node_composit_exec_brightcontrast(), node_composit_exec_channel_matte(), node_composit_exec_chroma_matte(), node_composit_exec_color_matte(), node_composit_exec_color_spill(), node_composit_exec_composite(), node_composit_exec_defocus(), node_composit_exec_diff_matte(), node_composit_exec_dilateerode(), node_composit_exec_displace(), node_composit_exec_distance_matte(), node_composit_exec_glare(), node_composit_exec_hue_sat(), node_composit_exec_luma_matte(), node_composit_exec_mapuv(), node_composit_exec_output_file(), node_composit_exec_premulkey(), node_composit_exec_rotate(), node_composit_exec_scale(), node_composit_exec_sephsva(), node_composit_exec_seprgba(), node_composit_exec_sepycca(), node_composit_exec_sepyuva(), node_composit_exec_splitviewer(), node_composit_exec_stabilize2d(), node_composit_exec_texture(), node_composit_exec_tonemap(), node_composit_exec_transform(), node_composit_exec_vecblur(), node_composit_exec_view_levels(), node_composit_exec_viewer(), node_composit_exec_zcombine(), setExecutableNodes(), star4(), and streaks().

void gamma_correct_compbuf ( CompBuf img,
int  inversed 
)
void generate_preview ( void *  data,
bNode node,
CompBuf stackbuf 
)
static CompBuf* generate_procedural_preview ( CompBuf cbuf,
int  newx,
int  newy 
) [static]
CompBuf* get_cropped_compbuf ( rcti drect,
float *  rectf,
int  rectx,
int  recty,
int  type 
)
void IIR_gauss ( CompBuf src,
float  sigma,
int  chan,
int  xy 
)
static unsigned int nextPow2 ( unsigned int  x,
unsigned int *  L2 
) [static]

Definition at line 793 of file node_composite_util.c.

Referenced by convolve().

void node_compo_pass_on ( void *  UNUSEDdata,
int   UNUSEDthread,
struct bNode node,
void *  UNUSEDnodedata,
struct bNodeStack **  in,
struct bNodeStack **  out 
)
CompBuf* pass_on_compbuf ( CompBuf cbuf)
void premul_compbuf ( CompBuf img,
int  inversed 
)
void print_compbuf ( char *  str,
CompBuf cbuf 
)

Definition at line 122 of file node_composite_util.c.

References CompBuf::rect, CompBuf::x, and CompBuf::y.

void qd_addPixel ( CompBuf src,
int  x,
int  y,
float *  col 
)

Definition at line 1182 of file node_composite_util.c.

References CompBuf::rect, CompBuf::type, and CompBuf::x.

CompBuf* qd_downScaledCopy ( CompBuf src,
int  scale 
)
void qd_getPixel ( CompBuf src,
int  x,
int  y,
float *  col 
)
void qd_getPixelLerp ( CompBuf src,
float  u,
float  v,
float *  col 
)
void qd_getPixelLerpChan ( CompBuf src,
float  u,
float  v,
int  chan,
float *  out 
)

Definition at line 1247 of file node_composite_util.c.

References B, CompBuf::rect, CompBuf::type, CompBuf::x, and CompBuf::y.

Referenced by lensDistort().

void qd_getPixelLerpWrap ( CompBuf src,
float  u,
float  v,
float *  col 
)

Definition at line 1200 of file node_composite_util.c.

References CB_VAL, CompBuf::rect, CompBuf::type, CompBuf::x, and CompBuf::y.

Referenced by dblur().

void qd_multPixel ( CompBuf src,
int  x,
int  y,
float  f 
)

Definition at line 1191 of file node_composite_util.c.

References CompBuf::rect, CompBuf::type, and CompBuf::x.

void qd_setPixel ( CompBuf src,
int  x,
int  y,
float *  col 
)
static unsigned int revbin_upd ( unsigned int  r,
unsigned int  h 
) [static]

Definition at line 807 of file node_composite_util.c.

Referenced by FHT().

CompBuf* scalefast_compbuf ( CompBuf inbuf,
int  newx,
int  newy 
)
CompBuf* typecheck_compbuf ( CompBuf inbuf,
int  type 
)
void typecheck_compbuf_color ( float *  out,
float *  in,
int  outtype,
int  intype 
)

Definition at line 221 of file node_composite_util.c.

References CB_RGBA, CB_VAL, CB_VEC2, and CB_VEC3.

Referenced by texture_procedural().

CompBuf* valbuf_from_rgbabuf ( CompBuf cbuf,
int  channel 
)