[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49423] trunk/blender/source/blender: remove references to raskter from compositor and BKE mask.

Campbell Barton ideasman42 at gmail.com
Tue Jul 31 18:04:48 CEST 2012


Revision: 49423
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49423
Author:   campbellbarton
Date:     2012-07-31 16:04:47 +0000 (Tue, 31 Jul 2012)
Log Message:
-----------
remove references to raskter from compositor and BKE mask.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_mask.h
    trunk/blender/source/blender/blenkernel/intern/mask.c
    trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c
    trunk/blender/source/blender/compositor/operations/COM_MaskOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_MaskOperation.h
    trunk/blender/source/blender/nodes/composite/nodes/node_composite_mask.c

Modified: trunk/blender/source/blender/blenkernel/BKE_mask.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_mask.h	2012-07-31 15:45:01 UTC (rev 49422)
+++ trunk/blender/source/blender/blenkernel/BKE_mask.h	2012-07-31 16:04:47 UTC (rev 49423)
@@ -185,23 +185,8 @@
 
 void BKE_mask_layer_shape_changed_remove(struct MaskLayer *masklay, int index, int count);
 
-/* rasterization */
 int BKE_mask_get_duration(struct Mask *mask);
 
-void BKE_mask_rasterize_layers(struct ListBase *masklayers, int width, int height, float *buffer,
-                               const short do_aspect_correct, const short do_mask_aa,
-                               const short do_feather);
-
-void BKE_mask_rasterize(struct Mask *mask, int width, int height, float *buffer,
-                        const short do_aspect_correct, const short do_mask_aa,
-                        const short do_feather);
-
-/* initialization for tiling */
-#ifdef __PLX_RASKTER_MT__
-void BKE_mask_init_layers(Mask *mask, struct layer_init_data *mlayer_data, int width, int height,
-							 const short do_aspect_correct);
-#endif
-
 #define MASKPOINT_ISSEL_ANY(p)          ( ((p)->bezt.f1 | (p)->bezt.f2 | (p)->bezt.f2) & SELECT)
 #define MASKPOINT_ISSEL_KNOT(p)         ( (p)->bezt.f2 & SELECT)
 #define MASKPOINT_ISSEL_HANDLE_ONLY(p)  ( (((p)->bezt.f1 | (p)->bezt.f2) & SELECT) && (((p)->bezt.f2 & SELECT) == 0) )
@@ -216,11 +201,7 @@
 
 #define MASK_RESOL_MAX 128
 
-/* disable to test alternate rasterizer */
-/* #define USE_RASKTER */
-
 /* mask_rasterize.c */
-#ifndef USE_RASKTER
 struct MaskRasterHandle;
 typedef struct MaskRasterHandle MaskRasterHandle;
 
@@ -236,6 +217,4 @@
                                            const unsigned int width, const unsigned int height,
                                            float *buffer);
 
-#endif /* USE_RASKTER */
-
 #endif /* __BKE_MASK_H__ */

Modified: trunk/blender/source/blender/blenkernel/intern/mask.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask.c	2012-07-31 15:45:01 UTC (rev 49422)
+++ trunk/blender/source/blender/blenkernel/intern/mask.c	2012-07-31 16:04:47 UTC (rev 49423)
@@ -56,8 +56,6 @@
 #include "BKE_movieclip.h"
 #include "BKE_utildefines.h"
 
-#include "raskter.h"
-
 static MaskSplinePoint *mask_spline_point_next(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
 {
 	if (point == &points_array[spline->tot_point - 1]) {
@@ -2535,256 +2533,7 @@
 	}
 }
 
-/* local functions */
-static void invert_vn_vn(float *array, const int size)
-{
-	float *arr = array + (size - 1);
-	int i = size;
-	while (i--) {
-		*(arr) = 1.0f - *(arr);
-		arr--;
-	}
-}
-
-static void m_invert_vn_vn(float *array, const float f, const int size)
-{
-	float *arr = array + (size - 1);
-	int i = size;
-	while (i--) {
-		*(arr) = 1.0f - (*(arr) * f);
-		arr--;
-	}
-}
-
-static void clamp_vn_vn(float *array, const int size)
-{
-	float *arr = array + (size - 1);
-
-	int i = size;
-	while (i--) {
-		if      (*arr < 0.0f) *arr = 0.0f;
-		else if (*arr > 1.0f) *arr = 1.0f;
-		arr--;
-	}
-}
-
 int BKE_mask_get_duration(Mask *mask)
 {
-	return MAX2(1, mask->efra - mask->sfra);
+	return maxi(1, mask->efra - mask->sfra);
 }
-
-/* rasterization */
-void BKE_mask_rasterize_layers(ListBase *masklayers, int width, int height, float *buffer,
-                               const short do_aspect_correct, const short do_mask_aa,
-                               const short do_feather)
-{
-	MaskLayer *masklay;
-
-	/* temp blending buffer */
-	const int buffer_size = width * height;
-	float *buffer_tmp = MEM_mallocN(sizeof(float) * buffer_size, __func__);
-
-	for (masklay = masklayers->first; masklay; masklay = masklay->next) {
-		MaskSpline *spline;
-		float alpha;
-
-		if (masklay->restrictflag & MASK_RESTRICT_RENDER) {
-			continue;
-		}
-
-		memset(buffer_tmp, 0, sizeof(float) * buffer_size);
-
-		for (spline = masklay->splines.first; spline; spline = spline->next) {
-			float (*diff_points)[2];
-			int tot_diff_point;
-
-			float (*diff_feather_points)[2];
-			int tot_diff_feather_points;
-
-			diff_points = BKE_mask_spline_differentiate_with_resolution(spline, width, height,
-			                                                            &tot_diff_point);
-
-			if (tot_diff_point) {
-				if (do_feather) {
-					diff_feather_points =
-					        BKE_mask_spline_feather_differentiated_points_with_resolution(spline, width, height,
-					                                                                      &tot_diff_feather_points);
-				}
-				else {
-					tot_diff_feather_points = 0;
-					diff_feather_points = NULL;
-				}
-
-				if (do_aspect_correct) {
-					if (width != height) {
-						float *fp;
-						float *ffp;
-						int i;
-						float asp;
-
-						if (width < height) {
-							fp = &diff_points[0][0];
-							ffp = tot_diff_feather_points ? &diff_feather_points[0][0] : NULL;
-							asp = (float)width / (float)height;
-						}
-						else {
-							fp = &diff_points[0][1];
-							ffp = tot_diff_feather_points ? &diff_feather_points[0][1] : NULL;
-							asp = (float)height / (float)width;
-						}
-
-						for (i = 0; i < tot_diff_point; i++, fp += 2) {
-							(*fp) = (((*fp) - 0.5f) / asp) + 0.5f;
-						}
-
-						if (tot_diff_feather_points) {
-							for (i = 0; i < tot_diff_feather_points; i++, ffp += 2) {
-								(*ffp) = (((*ffp) - 0.5f) / asp) + 0.5f;
-							}
-						}
-					}
-				}
-
-				if (tot_diff_point) {
-					PLX_raskterize(diff_points, tot_diff_point,
-                                   buffer_tmp, width, height,do_mask_aa);
-
-					if (tot_diff_feather_points) {
-						PLX_raskterize_feather(diff_points, tot_diff_point,
-						                       diff_feather_points, tot_diff_feather_points,
-						                       buffer_tmp, width, height);
-						MEM_freeN(diff_feather_points);
-					}
-
-					MEM_freeN(diff_points);
-				}
-			}
-		}
-
-		/* blend with original */
-		if (masklay->blend_flag & MASK_BLENDFLAG_INVERT) {
-			/* apply alpha multiply before inverting */
-			if (masklay->alpha != 1.0f) {
-				m_invert_vn_vn(buffer_tmp, masklay->alpha, buffer_size);
-			}
-			else {
-				invert_vn_vn(buffer_tmp, buffer_size);
-			}
-
-			alpha = 1.0f;
-		}
-		else {
-			alpha = masklay->alpha;
-		}
-
-		switch (masklay->blend) {
-			case MASK_BLEND_SUBTRACT:
-			{
-				if (alpha == 1.0f) {
-					sub_vn_vn(buffer, buffer_tmp, buffer_size);
-				}
-				else {
-					msub_vn_vn(buffer, buffer_tmp, alpha, buffer_size);
-				}
-				break;
-			}
-			case MASK_BLEND_ADD:
-			default:
-			{
-				if (alpha == 1.0f) {
-					add_vn_vn(buffer, buffer_tmp, buffer_size);
-				}
-				else {
-					madd_vn_vn(buffer, buffer_tmp, alpha, buffer_size);
-				}
-				break;
-			}
-		}
-
-		if (do_mask_aa) {
-			//PLX_antialias_buffer(buffer,width,height);
-		}
-		/* clamp at the end */
-		clamp_vn_vn(buffer, buffer_size);
-	}
-	MEM_freeN(buffer_tmp);
-}
-
-#ifdef __PLX_RASKTER_MT__
-void BKE_mask_init_layers(Mask *mask, struct layer_init_data *mlayer_data, int width, int height, const short do_aspect_correct)
-{
-	MaskLayer *masklay;
-	int numLayers=0;
-	int currLayer=0;
-	for (masklay = mask->masklayers->first; masklay; masklay = masklay->next) {
-		numLayers++;
-	}
-	mlayer_data = MEM_mallocN(sizeof(struct layer_init_data) * numLayers, __func__); //size correct?
-	
-	
-	for (masklay = mask->masklayers->first; masklay; masklay = masklay->next) {
-		MaskSpline *spline;
-		for (spline = masklay->splines.first; spline; spline = spline->next) {
-			float (*diff_points)[2];
-			int tot_diff_point;
-
-			float (*diff_feather_points)[2];
-			int tot_diff_feather_points;
-
-			diff_points = BKE_mask_spline_differentiate_with_resolution(spline, width, height,
-			                                                            &tot_diff_point);
-
-			if (tot_diff_point) {
-				if (do_feather) {
-					diff_feather_points =
-					        BKE_mask_spline_feather_differentiated_points_with_resolution(spline, width, height,
-					                                                                      &tot_diff_feather_points);
-				}
-				else {
-					tot_diff_feather_points = 0;
-					diff_feather_points = NULL;
-				}
-
-				if (do_aspect_correct) {
-					if (width != height) {
-						float *fp;
-						float *ffp;
-						int i;
-						float asp;
-
-						if (width < height) {
-							fp = &diff_points[0][0];
-							ffp = tot_diff_feather_points ? &diff_feather_points[0][0] : NULL;
-							asp = (float)width / (float)height;
-						}
-						else {
-							fp = &diff_points[0][1];
-							ffp = tot_diff_feather_points ? &diff_feather_points[0][1] : NULL;
-							asp = (float)height / (float)width;
-						}
-
-						for (i = 0; i < tot_diff_point; i++, fp += 2) {
-							(*fp) = (((*fp) - 0.5f) / asp) + 0.5f;
-						}
-
-						if (tot_diff_feather_points) {
-							for (i = 0; i < tot_diff_feather_points; i++, ffp += 2) {
-								(*ffp) = (((*ffp) - 0.5f) / asp) + 0.5f;
-							}
-						}
-					}
-				}
-				PLX_init_base_data(mlayer_data[currLayer], diff_points, tot_diff_points, width, height);
-				currLayer++;
-			}
-		}
-	}
-}
-#endif
-
-void BKE_mask_rasterize(Mask *mask, int width, int height, float *buffer,
-                        const short do_aspect_correct, const short do_mask_aa,
-                        const short do_feather)
-{
-	BKE_mask_rasterize_layers(&mask->masklayers, width, height, buffer, do_aspect_correct, do_mask_aa, do_feather);
-}

Modified: trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c	2012-07-31 15:45:01 UTC (rev 49422)
+++ trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c	2012-07-31 16:04:47 UTC (rev 49423)
@@ -45,8 +45,6 @@
 
 #include "BKE_mask.h"
 
-#ifndef USE_RASKTER
-
 /* this is rather and annoying hack, use define to isolate it.
  * problem is caused by scanfill removing edges on us. */
 #define USE_SCANFILL_EDGE_WORKAROUND
@@ -1317,5 +1315,3 @@
 		}
 	}
 }
-
-#endif /* USE_RASKTER */

Modified: trunk/blender/source/blender/compositor/operations/COM_MaskOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_MaskOperation.cpp	2012-07-31 15:45:01 UTC (rev 49422)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list