summaryrefslogtreecommitdiffstats
path: root/libass/ass_bitmap.h
Commit message (Collapse)AuthorAgeFilesLines
* renderer: quantize blur radius and shadow offsetDr.Smile2019-05-201-1/+1
|
* bitmap: make ass_synth_blur() work on single bitmapDr.Smile2019-05-201-2/+2
| | | | | | Now ass_synth_blur() blurs one bitmap only. Higher level decisions (to blur or not to blur) have moved outside of that function.
* bitmap: remove level of indirection in bitmap functionsDr.Smile2019-05-201-5/+4
| | | | | This allows to use Bitmap struct directly as cache value and to remove bunch of unnecessary allocations.
* bitmap: use types of fixed size in Bitmap structDr.Smile2019-05-201-6/+6
|
* Consolidate and quantize all transformationsDr.Smile2019-05-201-12/+0
| | | | | | | | | | | | | | This commit defers all outline transformations until rasterization stage. Combined transformation is then quantized and used as bitmap key. That should improve performance of slow animations. Also caching of initial and stroked outlines and bitmaps is now separate in preparation to proper error estimation for stroker stage. Note that Z-clipping for perspective transformations is now done differently compared to VSFilter. That clipping is mostly safety feature to protect from overflows and divisions by zero and is almost never triggered in real-world subtitles.
* Replace FreeType types with libass native typesDr.Smile2017-09-171-2/+1
| | | | | | FT_Vector and FT_BBox types are based on FT_Pos, which is alias of long. FreeType treats it as 32-bit integer, but on some platforms long can be 64-bit. That leads to wasted memory and suboptimal performance.
* renderer: fix handling of empty outlinesDr.Smile2017-07-311-3/+3
|
* renderer: switch to using two border outlines instead of oneDr.Smile2017-07-311-4/+6
|
* renderer: remove legacy FreeType rasterizerDr.Smile2017-07-311-2/+0
|
* cosmetic: extract most of the outline-related functions into separate fileDr.Smile2017-07-311-9/+1
|
* bitmap: use calloc instead of malloc/memsetRodger Combs2016-09-241-1/+1
| | | | This can improve perf somewhat with large bitmaps
* Implement cascade gaussian blurDr.Smile2015-07-041-9/+22
| | | | | | | | | | That's complete version with SSE2/AVX2 assembly. Should be much faster than old algorithm even in pure C. Algorithm description can be found in this article (PDF): https://github.com/MrSmile/CascadeBlur/releases Close #9
* Switch to virtual function tableDr.Smile2015-06-261-18/+52
| | | | | | | | | | Use one pointer to table of functions instead of scattered bunch of function pointers. Different versions of these tables can be constructed in compile time. Also, bitmap memory alignment now depends only on SSE2/AVX2 support and is constant for every width. That simplifies code without noticeable performance penalty.
* Add enough padding for \be to avoid clippingOleg Oshmyan2015-02-101-0/+1
| | | | | To avoid making bitmaps unnecessarily large, use just the necessary amount of padding for the given \be value.
* Calculate \be using [0..64] value range (like VSFilter)Oleg Oshmyan2015-02-101-0/+4
| | | | | | | | | | | | | To avoid banding in the output, the full [0..255] value range is restored before the last \be pass, which then uses the full range and hides the bands by virtue of being a blur. With this, our \be finally closely matches VSFilter's. The only visible difference (other than the lack of banding) is in clipping: we add proper padding and output the whole blurred image, while VSFilter does not add any padding and hence clips the blurred image too early.
* Clean up bitmap combiningDr.Smile2015-01-281-10/+6
| | | | | | | | | | Now pre- and post-combining operations are clearly separated, many parameters in cache keys are no longer necessary due to that. Also an ambiguous (in case of multiple fonts) text string is replaced with a list of direct bitmap references in composite cache key. Fixes #153. Fixes #82.
* Replace FT_Outline with ASS_OutlineDr.Smile2014-11-231-2/+12
|
* Move apply_blur() to ass_bitmap.cwm42014-11-131-15/+5
| | | | Put all code into one place, which makes it easier to follow.
* Remove bitmap restridingwm42014-06-011-3/+0
| | | | It turns out we don't need this.
* Implement fast quad-tree rasterizer in C and x86/SSE2/AVX2Dr.Smile2014-04-291-3/+2
| | | | Signed-off-by: Rodger Combs <rodger.combs@gmail.com>
* Use a function for aligned memory allocationswm42014-02-021-2/+1
| | | | ...instead of doing this manually.
* Combine bitmaps before applying blur and shadow11rcombs2014-01-251-2/+41
|
* Properly render opaque box shadows even when there is no borderOleg Oshmyan2012-12-281-1/+2
| | | | | | | | | | | | 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).
* bitmap: add strideGrigori Goronzy2011-06-261-0/+1
| | | | | Add stride support to the basic bitmap type used for low-level rasterization.
* Remove unused functionGrigori Goronzy2011-06-211-1/+0
|
* Convert to high-level rasterizer parts to outlinesGrigori Goronzy2011-06-151-5/+7
| | | | | This covers rasterization, filtering and blending for one render item.
* 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.
* Check vector clip mask bounding box sizeGrigori Goronzy2010-08-011-0/+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.
* opaque box: do not subtract glyph from borderGrigori Goronzy2009-09-011-1/+2
| | | | | Similar to VSFilter, do not subtract the glyph bitmap from the border bitmap when BorderStyle 3 is used.
* Rename typedefs (breaks API)Grigori Goronzy2009-08-061-7/+7
| | | | | | 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-2/+2
| | | | | 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.
* Message callback funtionalityGrigori Goronzy2009-07-111-4/+6
| | | | | | | | | | | 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]".
* Subpixel accurate shadow renderingGrigori Goronzy2009-06-291-1/+1
| | | | | | | | | 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.
* Reindent all source code.greg2009-06-201-10/+11
| | | | | | | | | | | | | | | 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
* Use blur with kernel [[1,2,1], [2,4,2], [1,2,1]] for \be.greg2009-03-061-1/+1
| | | | | | 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
* Allow \be with arguments other than 0 or 1. Implement \blur.eugeni2009-02-071-2/+2
| | | | | | Patch by Grigori G, greg at chown ath cx. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28471 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
* Add missing header #includes to fix 'make checkheaders'.diego2008-03-051-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26170 b3059339-0415-0410-9bf9-f77b7e298cf2
* Consistently give all libass multiple inclusion guards a LIBASS_ prefix.diego2008-01-291-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25927 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add explanatory comments to the #endif part of multiple inclusion guards.diego2007-12-311-2/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25563 b3059339-0415-0410-9bf9-f77b7e298cf2
* Do not use leading underscores in multiple inclusion guards, they are reserved.diego2007-07-021-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23709 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
* 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/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19972 b3059339-0415-0410-9bf9-f77b7e298cf2
* Shadow support in libass.eugeni2006-09-241-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19971 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add \be (blur edges) support to libass.eugeni2006-09-161-1/+6
| | | | 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/+14
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