summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-09-01 02:39:51 +0200
committerGrigori Goronzy <greg@blackbox>2009-09-01 02:39:51 +0200
commite4e0ac252792981699532c4076569946c9719999 (patch)
tree2208147434af393fec23d62d2ce5f6bce27b82d2
parent8407e392667a2f37eaca4fabfcf6bd7ca42aaed5 (diff)
downloadlibass-e4e0ac252792981699532c4076569946c9719999.tar.bz2
libass-e4e0ac252792981699532c4076569946c9719999.tar.xz
opaque box: do not subtract glyph from border
Similar to VSFilter, do not subtract the glyph bitmap from the border bitmap when BorderStyle 3 is used.
-rw-r--r--libass/ass_bitmap.c7
-rw-r--r--libass/ass_bitmap.h3
-rw-r--r--libass/ass_render.c3
3 files changed, 9 insertions, 4 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c
index e2018ce..1ae2d7c 100644
--- a/libass/ass_bitmap.c
+++ b/libass/ass_bitmap.c
@@ -475,7 +475,8 @@ static void be_blur(unsigned char *buf, int w, int h)
int glyph_to_bitmap(ASS_Library *library, ASS_SynthPriv *priv_blur,
FT_Glyph glyph, FT_Glyph outline_glyph,
Bitmap **bm_g, Bitmap **bm_o, Bitmap **bm_s,
- int be, double blur_radius, FT_Vector shadow_offset)
+ int be, double blur_radius, FT_Vector shadow_offset,
+ int border_style)
{
blur_radius *= 2;
int bbord = be > 0 ? sqrt(2 * be) : 0;
@@ -527,7 +528,9 @@ int glyph_to_bitmap(ASS_Library *library, ASS_SynthPriv *priv_blur,
priv_blur->g_w);
}
- if (*bm_o)
+ if (*bm_o && border_style == 3)
+ *bm_s = copy_bitmap(*bm_o);
+ else if (*bm_o)
*bm_s = fix_outline_and_shadow(*bm_g, *bm_o);
else
*bm_s = copy_bitmap(*bm_g);
diff --git a/libass/ass_bitmap.h b/libass/ass_bitmap.h
index 3b63cee..338db01 100644
--- a/libass/ass_bitmap.h
+++ b/libass/ass_bitmap.h
@@ -49,7 +49,8 @@ typedef struct {
int glyph_to_bitmap(ASS_Library *library, ASS_SynthPriv *priv_blur,
FT_Glyph glyph, FT_Glyph outline_glyph,
Bitmap **bm_g, Bitmap **bm_o, Bitmap **bm_s,
- int be, double blur_radius, FT_Vector shadow_offset);
+ int be, double blur_radius, FT_Vector shadow_offset,
+ int border_style);
void ass_free_bitmap(Bitmap *bm);
diff --git a/libass/ass_render.c b/libass/ass_render.c
index f67cba6..514dfbe 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -2161,7 +2161,8 @@ get_bitmap_glyph(ASS_Renderer *render_priv, GlyphInfo *info)
&info->bm, &info->bm_o,
&info->bm_s, info->be,
info->blur * render_priv->border_scale,
- info->hash_key.shadow_offset);
+ info->hash_key.shadow_offset,
+ info->hash_key.border_style);
if (error)
info->symbol = 0;