diff options
author | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-15 22:45:34 +0000 |
---|---|---|
committer | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-15 22:45:34 +0000 |
commit | 729505d31a6ddd5c2dccd0a3d309e9ca6641126a (patch) | |
tree | 46972b8882e3fc4e861963f47152f47bfc2f6281 /TOOLS/subfont-c | |
parent | 23d10418687f1ea753305e813a1bbfbb3909cbfd (diff) | |
download | mpv-729505d31a6ddd5c2dccd0a3d309e9ca6641126a.tar.bz2 mpv-729505d31a6ddd5c2dccd0a3d309e9ca6641126a.tar.xz |
skip black in outline (white skip code is #if 0 as there is no speed difference)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7019 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS/subfont-c')
-rw-r--r-- | TOOLS/subfont-c/subfont.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/TOOLS/subfont-c/subfont.c b/TOOLS/subfont-c/subfont.c index 5b7e131ab0..9439c9ae61 100644 --- a/TOOLS/subfont-c/subfont.c +++ b/TOOLS/subfont-c/subfont.c @@ -508,6 +508,38 @@ void outline( int mwidth) { int x, y; +#if 1 + for (y = 0; y<height; y++) { + for (x = 0; x<width; x++) { + const int src= s[x]; + if(src==0) continue; +#if 0 + if(src==255 && x>0 && y>0 && x+1<width && y+1<height + && s[x-1]==255 && s[x+1]==255 && s[x-width]==255 && s[x+width]==255){ + t[x + y*width]=255; + }else +#endif + { + const int x1=(x<r) ? r-x : 0; + const int y1=(y<r) ? r-y : 0; + const int x2=(x+r>=width ) ? r+width -x : 2*r+1; + const int y2=(y+r>=height) ? r+height-y : 2*r+1; + int my; + + for(my= y1; my<y2; my++){ + unsigned char *dstp= t + (my+y-r)* width + x-r; + int *mp = m + my *mwidth; + int mx; + for(mx= x1; mx<x2; mx++){ + const int tmp= (src*mp[mx] + 128)>>8; + if(dstp[mx] < tmp) dstp[mx]= tmp; + } + } + } + } + s+= width; + } +#else for (y = 0; y<height; ++y) { for (x = 0; x<width; ++x, ++s, ++t) { //if(s[0]>=192) printf("%d\n",s[0]); @@ -535,6 +567,7 @@ void outline( *t = 255; } } +#endif } |