]> granicus.if.org Git - libass/commitdiff
Merge glyph and outline bitmap better
authorGrigori Goronzy <greg@blackbox>
Sun, 12 Jul 2009 05:21:52 +0000 (07:21 +0200)
committerGrigori Goronzy <greg@blackbox>
Sun, 12 Jul 2009 05:25:34 +0000 (07:25 +0200)
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.

libass/ass_bitmap.c

index 1e9603b8f4ab4b4538dc3b90509b768ce5b7eecb..3642be82648c9655fd9b476a4dbf50d7be479c18 100644 (file)
@@ -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;