comparison libass/ass_bitmap.c @ 20874:b6d87b58754f

Partial fix for semitransparent glyph outlines. This fix removes semitransparent area (less then pixel width) between glyph and it's outline. Instead, it makes them overlap a little. It usually looks much better this way. Complete fix seems impossible with the current output format (single color alpha bitmaps). The right way is to blend both glyph and outline into one bitmap so that 2 pixels with 50% transparency produce a fully solid one. This requires RGBA bitmap output from libass.
author eugeni
date Mon, 13 Nov 2006 16:35:15 +0000
parents e8885ec63928
children d138463e820b
comparison
equal deleted inserted replaced
20873:8f0c616d7425 20874:b6d87b58754f
217 for (y = 0; y < b - t; ++y) { 217 for (y = 0; y < b - t; ++y) {
218 for (x = 0; x < r - l; ++x) { 218 for (x = 0; x < r - l; ++x) {
219 unsigned char c_g, c_o; 219 unsigned char c_g, c_o;
220 c_g = g[x]; 220 c_g = g[x];
221 c_o = o[x]; 221 c_o = o[x];
222 o[x] = (c_o > c_g) ? c_o - c_g : 0; 222 o[x] = (c_o > c_g) ? c_o : 0;
223 s[x] = (c_o < 0xFF - c_g) ? c_o + c_g : 0xFF; 223 s[x] = (c_o < 0xFF - c_g) ? c_o + c_g : 0xFF;
224 } 224 }
225 g += bm_g->w; 225 g += bm_g->w;
226 o += bm_o->w; 226 o += bm_o->w;
227 s += bm_s->w; 227 s += bm_s->w;