Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-07-31 20:04:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-31 20:04:47 +0400
commit4c02549d5d90c698946c6beb9df344c05e453158 (patch)
tree12ad718582db598b16261832e38ff28c875aca0e /source/blender/blenkernel
parent2e5181195057b8e8525f2f91c107d6d67e2bdf3a (diff)
remove references to raskter from compositor and BKE mask.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_mask.h21
-rw-r--r--source/blender/blenkernel/intern/mask.c253
-rw-r--r--source/blender/blenkernel/intern/mask_rasterize.c4
3 files changed, 1 insertions, 277 deletions
diff --git a/source/blender/blenkernel/BKE_mask.h b/source/blender/blenkernel/BKE_mask.h
index 6c2e2b5d0f3..1148cffffb4 100644
--- a/source/blender/blenkernel/BKE_mask.h
+++ b/source/blender/blenkernel/BKE_mask.h
@@ -185,23 +185,8 @@ void BKE_mask_layer_shape_changed_add(struct MaskLayer *masklay, int index,
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 @@ void BKE_mask_init_layers(Mask *mask, struct layer_init_data *mlayer_data, int w
#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 @@ void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle,
const unsigned int width, const unsigned int height,
float *buffer);
-#endif /* USE_RASKTER */
-
#endif /* __BKE_MASK_H__ */
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index a088a91000c..bb6e4d82bd2 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -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 @@ void BKE_mask_layer_shape_changed_remove(MaskLayer *masklay, int index, int coun
}
}
-/* 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);
-}
-
-/* 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);
+ return maxi(1, mask->efra - mask->sfra);
}
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 6811a6fea18..ce04ad31a33 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -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 @@ void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle,
}
}
}
-
-#endif /* USE_RASKTER */