From 461ba65d18957aa20c686c22d4f73d930c602146 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Thu, 13 Mar 2014 03:05:11 +0000 Subject: [PATCH] Apply \be after \blur (like VSFilter) --- libass/ass_bitmap.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 19c4727..97fb26b 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -146,6 +146,20 @@ void ass_synth_blur(ASS_SynthPriv *priv_blur, int opaque_box, int be, return; } + // Apply gaussian blur + if (blur_radius > 0.0 && generate_tables(priv_blur, blur_radius)) { + if (bm_o) + ass_gauss_blur(bm_o->buffer, priv_blur->tmp, + bm_o->w, bm_o->h, bm_o->stride, + priv_blur->gt2, priv_blur->g_r, + priv_blur->g_w); + if (!bm_o || opaque_box) + ass_gauss_blur(bm_g->buffer, priv_blur->tmp, + bm_g->w, bm_g->h, bm_g->stride, + priv_blur->gt2, priv_blur->g_r, + priv_blur->g_w); + } + // Apply box blur (multiple passes, if requested) if (be) { uint16_t* tmp = priv_blur->tmp; @@ -180,20 +194,6 @@ void ass_synth_blur(ASS_SynthPriv *priv_blur, int opaque_box, int be, } } } - - // Apply gaussian blur - if (blur_radius > 0.0 && generate_tables(priv_blur, blur_radius)) { - if (bm_o) - ass_gauss_blur(bm_o->buffer, priv_blur->tmp, - bm_o->w, bm_o->h, bm_o->stride, - priv_blur->gt2, priv_blur->g_r, - priv_blur->g_w); - if (!bm_o || opaque_box) - ass_gauss_blur(bm_g->buffer, priv_blur->tmp, - bm_g->w, bm_g->h, bm_g->stride, - priv_blur->gt2, priv_blur->g_r, - priv_blur->g_w); - } } ASS_SynthPriv *ass_synth_init(double radius) -- 2.40.0