Merge with -r 22620:23107.
[blender.git] / source / blender / nodes / intern / CMP_util.h
index 6fa5251710a61ef1ec978f414c08fa8a9ae9759b..2a2dc97ed73fc7d32f08193ee6a00a2e1026a266 100644 (file)
 #include "MEM_guardedalloc.h"
 
 #include "DNA_camera_types.h" /* qdn: defocus node, need camera info */
-#include "DNA_action_types.h"
 #include "DNA_color_types.h"
-#include "DNA_ipo_types.h"
 #include "DNA_ID.h"
 #include "DNA_image_types.h"
 #include "DNA_material_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
 #include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
 #include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
 
 #include "BKE_blender.h"
 #include "BKE_colortools.h"
 #include "../CMP_node.h"
 #include "node_util.h"
 
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_language.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
 #include "BLI_arithb.h"
 #include "BLI_blenlib.h"
 #include "BLI_rand.h"
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
 
-#include "BSE_drawipo.h"
-#include "BSE_node.h"
-#include "BSE_view.h"
-
 #include "RE_pipeline.h"
 #include "RE_shader_ext.h"
 #include "RE_render_ext.h"
 
-#include "butspace.h"
-#include "blendef.h"
-#include "mydevice.h"
-
 /* *************************** operations support *************************** */
 
 /* general signal that's in output sockets, and goes over the wires */
@@ -107,6 +83,8 @@ typedef struct CompBuf {
        int xof, yof;           /* relative to center of target image */
        
        void (*rect_procedural)(struct CompBuf *, float *, float, float);
+       float procedural_size[3], procedural_offset[3];
+       int procedural_type;
        bNode *node;            /* only in use for procedural bufs */
        
        struct CompBuf *next, *prev;    /* for pass-on, works nicer than reference counting */
@@ -132,10 +110,12 @@ CompBuf *dupalloc_compbuf(CompBuf *cbuf);
 CompBuf *pass_on_compbuf(CompBuf *cbuf);
 void free_compbuf(CompBuf *cbuf);
 void print_compbuf(char *str, CompBuf *cbuf);
+void node_compo_pass_on(struct bNode *node, struct bNodeStack **nsin, struct bNodeStack **nsout);
 
 CompBuf *get_cropped_compbuf(rcti *drect, float *rectf, int rectx, int recty, int type);
 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);
 float *compbuf_get_pixel(CompBuf *cbuf, float *rectf, int x, int y, int xrad, int yrad);
 
 /* **************************************************** */
@@ -188,7 +168,7 @@ typedef float fRGB[4];
 /* clear color */
 #define fRGB_clear(c) { c[0]=c[1]=c[2]=0.f; }
 /* copy c2 to c1 */
-#define fRGB_copy(c1, c2) { c1[0]=c2[0];  c1[1]=c2[1];  c1[2]=c2[2]; }
+#define fRGB_copy(c1, c2) { c1[0]=c2[0];  c1[1]=c2[1];  c1[2]=c2[2]; c1[3]=c2[3]; }
 /* add c2 to c1 */
 #define fRGB_add(c1, c2) { c1[0]+=c2[0];  c1[1]+=c2[1];  c1[2]+=c2[2]; }
 /* subtract c2 from c1 */
@@ -206,7 +186,8 @@ typedef float fRGB[4];
 /* swap colors c1 & c2 */
 #define fRGB_swap(c1, c2) { float _t=c1[0];  c1[0]=c2[0];  c2[0]=_t;\
                                   _t=c1[1];  c1[1]=c2[1];  c2[1]=_t;\
-                                  _t=c1[2];  c1[2]=c2[2];  c2[2]=_t; }
+                                  _t=c1[2];  c1[2]=c2[2];  c2[2]=_t;\
+                                                                 _t=c1[3];  c1[3]=c2[3];  c3[3]=_t;}
 
 void qd_getPixel(CompBuf* src, int x, int y, float* col);
 void qd_setPixel(CompBuf* src, int x, int y, float* col);