summaryrefslogtreecommitdiffstats
path: root/libass/ass_bitmap.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-07-12 07:21:52 +0200
committerGrigori Goronzy <greg@blackbox>2009-07-12 07:25:34 +0200
commitd3cd5b0148d64ae0f6e288e69b09acfe639fdcce (patch)
tree053468663d70c65523ef1092df23b850f16c63bc /libass/ass_bitmap.c
parent1baeba8197174a0b23bb6344c4175df336568d55 (diff)
downloadlibass-d3cd5b0148d64ae0f6e288e69b09acfe639fdcce.tar.bz2
libass-d3cd5b0148d64ae0f6e288e69b09acfe639fdcce.tar.xz
Merge glyph and outline bitmap better
Use a different threshold for merging the outline and glyph and also adjust the merge amount. This fails to give complete transparency (and thus will yield slightly darker looking glyphs, usually), but avoids very ugly looking artefacts at the edge between border and glyph that were still prevalent.
Diffstat (limited to 'libass/ass_bitmap.c')
-rw-r--r--libass/ass_bitmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c
index 1e9603b..3642be8 100644
--- a/libass/ass_bitmap.c
+++ b/libass/ass_bitmap.c
@@ -261,7 +261,7 @@ static bitmap_t *fix_outline_and_shadow(bitmap_t *bm_g, bitmap_t *bm_o)
unsigned char c_g, c_o;
c_g = g[x];
c_o = o[x];
- o[x] = (c_o > c_g) ? c_o - (c_g / 2) : 0;
+ o[x] = (c_o > (3 * c_g) / 5) ? c_o - (3 * c_g) / 5 : 0;
s[x] = (c_o < 0xFF - c_g) ? c_o + c_g : 0xFF;
}
g += bm_g->w;