From 326332e89f2b0edc4ab91950c898788335206bb5 Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Mon, 22 Dec 2008 14:29:29 +0000 Subject: [PATCH] Expose blur_alpha_surface() as the image-path function ~BL() ~BL() takes only one argument, which seems to be the radius of blur (blur_alpha_surface(), 2nd argument a.k.a. 'depth'). --- src/image.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/image.cpp b/src/image.cpp index 5f0c24a3e33..6a8c09df4a5 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -355,6 +355,8 @@ surface locator::load_image_sub_file() const SDL_Rect slice_rect = { 0,0,0,0 }; // ~CS() arguments int cs_r = 0, cs_g = 0, cs_b = 0; + // ~BL() arguments + unsigned blur = 0; std::map recolor_map; std::vector modlist = utils::paranthetical_split(val_.modifications_,'~'); @@ -479,6 +481,9 @@ surface locator::load_image_sub_file() const slice_rect.h = lexical_cast_default(slice_params[3]); } } + else if("BL" == function) { // Blur + blur = std::max(0, lexical_cast_default(field)); + } // ~R(), ~G() and ~B() are the children of ~CS(). Merely syntatic sugar. // Hence they are at the end of the evaluation. else if("R" == function) { @@ -526,6 +531,9 @@ surface locator::load_image_sub_file() const if(greyscale) { surf = greyscale_image(surf); } + if(blur) { + surf = blur_alpha_surface(surf, blur); + } } return surf; }