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>2011-06-15 06:14:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-15 06:14:38 +0400
commitb89924f5dde483fffbd071a5c84713a2bb357557 (patch)
tree6e9a836f306479ccc7df460f3e7dfd6c64c2c4ed /source/blender/editors/object
parent1d41694e6974ee870fdeef2a5516d8368a2b9853 (diff)
de-duplicate multires image filter function. (no functional change)
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_bake.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index c669a69b157..fc5f09f2fe0 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -854,49 +854,11 @@ static void finish_images(MultiresBakeRender *bkr)
Image *ima= (Image*)link->data;
int i;
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
- short is_new_alpha;
if(ibuf->x<=0 || ibuf->y<=0)
continue;
- /* must check before filtering */
- is_new_alpha= (ibuf->depth != 32) && BKE_alphatest_ibuf(ibuf);
-
- /* Margin */
- if(bkr->bake_filter) {
- char *temprect;
-
- /* extend the mask +2 pixels from the image,
- * this is so colors dont blend in from outside */
-
- for(i=0; i<bkr->bake_filter; i++)
- IMB_mask_filter_extend((char *)ibuf->userdata, ibuf->x, ibuf->y);
-
- temprect = MEM_dupallocN(ibuf->userdata);
-
- /* expand twice to clear this many pixels, so they blend back in */
- IMB_mask_filter_extend(temprect, ibuf->x, ibuf->y);
- IMB_mask_filter_extend(temprect, ibuf->x, ibuf->y);
-
- /* clear all pixels in the margin */
- IMB_mask_clear(ibuf, temprect, FILTER_MASK_MARGIN);
- MEM_freeN(temprect);
-
- for(i= 0; i<bkr->bake_filter; i++)
- IMB_filter_extend(ibuf, (char *)ibuf->userdata);
- }
-
- /* if the bake results in new alpha then change the image setting */
- if(is_new_alpha) {
- ibuf->depth= 32;
- }
- else {
- if(bkr->bake_filter) {
- /* clear alpha added by filtering */
- IMB_rectfill_alpha(ibuf, 1.0f);
- }
- }
-
+ RE_bake_ibuf_filter(ibuf, (unsigned char *)ibuf->userdata, bkr->bake_filter);
ibuf->userflags|= IB_BITMAPDIRTY;
if(ibuf->mipmap[0]) {
@@ -1349,7 +1311,6 @@ static void finish_bake_internal(BakeRender *bkr)
/* freed when baking is done, but if its canceled we need to free here */
if (ibuf->userdata) {
- printf("freed\n");
MEM_freeN(ibuf->userdata);
ibuf->userdata= NULL;
}