summaryrefslogtreecommitdiffstats
path: root/libass/ass_bitmap.c
Commit message (Collapse)AuthorAgeFilesLines
* Use a function for aligned memory allocationswm42014-02-021-9/+8
| | | | ...instead of doing this manually.
* Fixed incorrect spelling in copyright notice11rcombs2014-01-291-1/+1
|
* Added copyright notice for xy \be blur11rcombs2014-01-271-0/+1
|
* Combine bitmaps before applying blur and shadow11rcombs2014-01-251-87/+138
|
* Don't forget to apply \be to the last row/columnOleg Oshmyan2013-12-171-0/+4
|
* Fix mismatched/out-of-bounds accesses in vertical \blurOleg Oshmyan2013-12-171-2/+2
|
* Speed up \blur table generationOleg Oshmyan2013-12-121-7/+11
| | | | Based on xy-VSFilter commit 54391d3a.
* Improve blur quality: use volume 65536 and initialize left columnOleg Oshmyan2013-12-121-36/+34
|
* Properly render opaque box shadows even when there is no borderOleg Oshmyan2012-12-281-2/+5
| | | | | | | | | | | | Even if the border size is zero, the shadow is supposed to be a copy of a hypothetical border: when border_style is 1, this coincides with the borderless glyph, but when border_style is 3, the shadow must be an opaque box. Opaque box borders are now generated regardless of border size being non-zero, and outline_to_bitmap3 gets a new flag indicating whether it should discard the border (after generating a shadow from it).
* Apply blur to both glyph and border when using opaque box bordersOleg Oshmyan2012-12-281-3/+3
|
* Fix box blur for non-bordered outlinesGrigori Goronzy2011-07-041-1/+1
| | | | | | This horrible bug was introduced by commit c13cb2. Pointed out by uau.
* Remove outdated commentGrigori Goronzy2011-06-261-2/+0
|
* bitmap: add strideGrigori Goronzy2011-06-261-36/+44
| | | | | Add stride support to the basic bitmap type used for low-level rasterization.
* Remove unused functionGrigori Goronzy2011-06-211-15/+0
|
* Convert to high-level rasterizer parts to outlinesGrigori Goronzy2011-06-151-13/+12
| | | | | This covers rasterization, filtering and blending for one render item.
* Render outlines, not glyphsGrigori Goronzy2011-06-131-34/+41
| | | | | | | | | | | | | | | | | | | libass can render both regular glyphs (extracted from a font) and drawings, which are inserted into an existing glyph so far. This is a rather crude hack. However, it is necessary, as the renderer only works with FT_Glyphs. The obvious solution is to work on the underlying outlines directly instead. This is the first step to make this possible: change the basic rasterizer to use the outline-specific rasterization functions. There are more advantages: - It's more efficient. The bitmap can be directly rendered into the bordered target bitmap. - This should make it easier to adapt the renderer to run-based rendering later on (the pixels are ORed into the target) The higher-level rendering code still needs to be adjusted.
* Relicense to ISCGrigori Goronzy2010-09-281-12/+10
| | | | | | In hope to make libass as useful as possible, relicense libass to ISC, a simplified 2-clause BSD license. All contributors who provided non-trivial changes have granted their permission for this.
* Get rid of NULL checks for freeGrigori Goronzy2010-08-091-13/+7
| | | | | The useless "if (foo) free(foo)" idiom is all over the place, just get rid of it finally...
* Check vector clip mask bounding box sizeGrigori Goronzy2010-08-011-1/+1
| | | | | | Similar to regular glyphs, check the bounding box of the clip mask and refrain from rendering humongous masks, which can take up considerably memory.
* Simple optimizations to memory handlingGrigori Goronzy2010-06-271-3/+2
|
* Copy shadow bitmap from glyph bitmapGrigori Goronzy2009-09-161-19/+13
| | | | | It's not necessary to create the shadow bitmap by adding the glyph bitmap to the outline bitmap; the outline is a superset of the glyph.
* opaque box: do not subtract glyph from borderGrigori Goronzy2009-09-011-2/+5
| | | | | Similar to VSFilter, do not subtract the glyph bitmap from the border bitmap when BorderStyle 3 is used.
* Revert "Merge glyph and outline bitmap better"Grigori Goronzy2009-09-011-1/+1
| | | | | | This reverts commit d3cd5b0148d64ae0f6e288e69b09acfe639fdcce. This hack improved blending in few situations, but at the same time broke it in lots o others; get rid of it.
* Rename typedefs (breaks API)Grigori Goronzy2009-08-061-18/+18
| | | | | | Rename all typedefs from the convention foo_bar_t, which can possibly conflict with POSIX types, to FooBar (and ASS_FooBar for public API typedefs). Fix formatting and stray comments while at it.
* Clean up typedefs/structsGrigori Goronzy2009-07-281-1/+1
| | | | | Remove useless _s suffix from struct names and remove struct name where not needed (only the typedef'd struct is used). Clean up API headers.
* Fix rasterizer error handling (double free)Grigori Goronzy2009-07-221-1/+0
| | | | | | In case rasterizing a glyph is successful, but rasterizing its outline is not, do not free the glyph bitmap. It will be freed in cache cleanup later. Freeing it earlier leads to a double free.
* Merge glyph and outline bitmap betterGrigori Goronzy2009-07-121-1/+1
| | | | | | | | 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.
* Redo border calculations for \be and \blurGrigori Goronzy2009-07-121-25/+28
| | | | | | | | | | The last commit related to this overdid it a bit -- in some cases, with \be5, for example, edges were visible on the outlines. Instead of using a linear function to map \be applications to border enlargement value, use a nonlinear function, a simple square root. This seems to work a lot better, while keeping the enlargement small. In addition, make it possible to use \be and \blur at the same time. \be is applied first.
* Message callback funtionalityGrigori Goronzy2009-07-111-9/+10
| | | | | | | | | | | Introduce functionality for providing a message callback that is used for passing messages to the controlling application instead of simply printing them to standard output. The function pointer to the callback is stored in the ass_library_t instance. ass_msg needs access to it, so in many places the library instance needs to be passed around now. The default behavior is the old one: messages of MSGL_INFO or lower are printed to the standard output, prefixed with "[ass]".
* Replace string defines with real stringsGrigori Goronzy2009-07-111-3/+3
| | | | | | Instead of referencing string defines from help_mp.h, use the strings directly in ass_msg. Consequently, help_mp.h is useless and can be deleted.
* Move gaussian blur into bitmap handling codeGrigori Goronzy2009-07-101-0/+121
|
* Slight optimizations for \be, \blurGrigori Goronzy2009-07-101-4/+4
| | | | | | | Enlarge bitmap glyphs less for \be, this is especially effective for lots of \be applications. Also make sure that the gaussian blur buffers are only updated if gaussian blur is actually used for a particular glyph.
* shift_bitmap: do not rely on compiler optimizationsGrigori Goronzy2009-06-291-4/+4
| | | | Do not rely on the compiler for optimizing a division into a shift.
* Subpixel accurate shadow renderingGrigori Goronzy2009-06-291-1/+56
| | | | | | | | | Shadows are handled different from glyph and outline. A shadow is the sum of glyph and outline bitmap; therefore shifting to the correct subpixel amount before rasterization is out of the question. Instead, the bitmap is shifted by its subpixel amount after being built from shadow and glyph. The bitmap cache was extended for this.
* Include ass_utils.h instead of mputils.hGrigori Goronzy2009-06-271-1/+1
|
* Rename various non-static functionsGrigori Goronzy2009-06-271-6/+8
| | | | | Rename a few functions to avoid symbol clashes. Clean up mputils.h.
* Rename mp_msg to ass_msgGrigori Goronzy2009-06-271-3/+3
|
* Reindent all source code.greg2009-06-201-253/+275
| | | | | | | | | | | | | | | Reindent complete source code (*.c, *.h) with indent, the exact command line being: indent -kr -i4 -bap -nut -l76 *.c *.h From now on, new code should use (more or less) K&R style, only spaces and no tabs, 4 spaces indent width. Avoid long lines. Fix function declaration pointer spacing. Remove spaces that were added to many function declarations by indent, like some_func(foo_t * bar). Fix indenting of macros in ass.c
* Enlarge glyph size more for \blur to avoid artefacts.greg2009-06-191-1/+1
|
* whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix \be blur start position.greg2009-03-061-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28837 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use blur with kernel [[1,2,1], [2,4,2], [1,2,1]] for \be.greg2009-03-061-8/+32
| | | | | | This is faster than gaussian blur and similar to vsfilter. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28834 b3059339-0415-0410-9bf9-f77b7e298cf2
* Hack: half-merge glyph border with outline to avoid ugly anti-aliasinggreg2009-03-051-1/+1
| | | | | | in certain situations. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28816 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix a memory leak.eugeni2009-03-011-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28787 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix memory leak produced by the \blur patch.eugeni2009-02-271-2/+2
| | | | | | Patch by Grigori G (greg chown ath cx). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28750 b3059339-0415-0410-9bf9-f77b7e298cf2
* Stronger blur.eugeni2009-02-271-0/+1
| | | | | | Patch by Grigori G (greg chown ath cx). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28749 b3059339-0415-0410-9bf9-f77b7e298cf2
* Allow \be with arguments other than 0 or 1. Implement \blur.eugeni2009-02-071-12/+32
| | | | | | Patch by Grigori G, greg at chown ath cx. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28471 b3059339-0415-0410-9bf9-f77b7e298cf2
* If (has outline) blur(outline) else blur(glyph).eugeni2008-08-071-1/+2
| | | | | | | | | | | If there is an outline, the glyph itself should not be blurred. Keeps the border between glyph and outline clear (unblurred), which is probably how it should be. Patch by Diogo Franco (diogomfranco gmail com). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27441 b3059339-0415-0410-9bf9-f77b7e298cf2
* Speak of libass instead of MPlayer in the libass license headers.diego2008-05-141-4/+4
| | | | | | | | We already use LIBASS_ prefixes for the multiple inclusion guards. Thus libass can be considered separate enough to warrant this. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26770 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use standard license header.diego2008-05-131-16/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26755 b3059339-0415-0410-9bf9-f77b7e298cf2
* Check glyph bounding box before rasterizing and complain if it is too large.eugeni2008-02-221-0/+16
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26067 b3059339-0415-0410-9bf9-f77b7e298cf2
* "()" to "(void)" function param list fixesuau2007-04-011-1/+1
| | | | | | | patch from Stefan Huehner, stefan huehner org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22904 b3059339-0415-0410-9bf9-f77b7e298cf2
* MSGTRs for libasskraymer2006-11-191-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21082 b3059339-0415-0410-9bf9-f77b7e298cf2
* Collect all includes of mplayer headers in libass in a single file (mputils.h).eugeni2006-11-191-2/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21042 b3059339-0415-0410-9bf9-f77b7e298cf2
* Partial fix for semitransparent glyph outlines.eugeni2006-11-131-1/+1
| | | | | | | | | | | | | 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20890 b3059339-0415-0410-9bf9-f77b7e298cf2
* Introduce MSGT_ASS, use it for all libass messages.eugeni2006-11-031-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20645 b3059339-0415-0410-9bf9-f77b7e298cf2
* Revert r20517.eugeni2006-10-291-116/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20519 b3059339-0415-0410-9bf9-f77b7e298cf2
* Copy the following functions to libass to avoid dependency on the rest of ↵eugeni2006-10-291-1/+116
| | | | | | | | | | | | mplayer: guess_buffer_cp utf8_get_char blur git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20517 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add copyright notice and vim/emacs comments to libass and vf_ass.c.eugeni2006-10-011-0/+20
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20014 b3059339-0415-0410-9bf9-f77b7e298cf2
* Cosmetics: add some comments.eugeni2006-09-241-0/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19972 b3059339-0415-0410-9bf9-f77b7e298cf2
* Shadow support in libass.eugeni2006-09-241-9/+30
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19971 b3059339-0415-0410-9bf9-f77b7e298cf2
* Free memory in ass_synth_done().eugeni2006-09-241-0/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19968 b3059339-0415-0410-9bf9-f77b7e298cf2
* Reduce size of non-blurred bitmaps.eugeni2006-09-231-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19962 b3059339-0415-0410-9bf9-f77b7e298cf2
* Cosmetics. Change indentation of block of code to make it consistent witheugeni2006-09-231-39/+39
| | | | | | | the rest of the file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19961 b3059339-0415-0410-9bf9-f77b7e298cf2
* Better fix_outline implementation. No more "fix_outline failed" messages,eugeni2006-09-231-12/+15
| | | | | | | should work even with the craziest glyphs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19947 b3059339-0415-0410-9bf9-f77b7e298cf2
* Reduce code duplication in init_render_context().eugeni2006-09-171-6/+9
| | | | | | | Don't use glyph stroker for borderless glyphs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19879 b3059339-0415-0410-9bf9-f77b7e298cf2
* Subtract glyph bitmap from outline bitmap.eugeni2006-09-161-0/+22
| | | | | | | It greatly improves display of glyphs with semitransparent primary color. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19862 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add \be (blur edges) support to libass.eugeni2006-09-161-3/+104
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19854 b3059339-0415-0410-9bf9-f77b7e298cf2
* Store bitmap glyphs in a separate struct, instead of FreeType's internal buffer.eugeni2006-09-161-0/+91
This is required for various bitmap modifications (like blur, outline and shadow). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19852 b3059339-0415-0410-9bf9-f77b7e298cf2