Oleg Oshmyan [Mon, 9 Feb 2015 22:26:59 +0000 (00:26 +0200)]
Use correct types in be_blur_c
Also fix a related sort-of-bug: a multiple of sizeof(uint16_t)
was being added to a pointer that already pointed to uint16_t.
This was not causing any harm given enough space in the buffer.
Fixing the above also lets us combine the two memsets.
Oleg Oshmyan [Thu, 13 Mar 2014 03:15:18 +0000 (03:15 +0000)]
Calculate \be using [0..64] value range (like VSFilter)
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.
Dr.Smile [Fri, 23 Jan 2015 03:32:16 +0000 (06:32 +0300)]
Clean up bitmap combining
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.
Oleg Oshmyan [Fri, 16 Jan 2015 11:26:13 +0000 (13:26 +0200)]
Add extern "C" guard to public header
Our public headers can be #included from C++. Hence, ass.h needs
an extern "C" guard to declare the correct linkage for functions.
ass_types.h only defines types, so it does not need a guard.
wm4 [Sun, 16 Nov 2014 16:23:12 +0000 (17:23 +0100)]
Check bitmap allocation for overflows
This actually fixes #146.
The overflow check itself is obvious. Also, make ass_align() return an
unaligned value if aligning it would overflow. This is probably better,
as it for example makes the overflow check in the caller simpler.
wm4 [Fri, 14 Nov 2014 00:45:09 +0000 (01:45 +0100)]
Fix the bug
Commit 8536eaa was slightly broken: for some incomprehensible reason,
(w + 1) memory instead of w is needed. The missing space could lead to
memory corruption and crashes.
wm4 [Thu, 16 Oct 2014 23:26:30 +0000 (01:26 +0200)]
Silence compilation warning
This fixes the following warnings:
In file included from ass_cache.c:34:0:
ass_cache_template.h:52:0: warning: "BINSTRING" redefined
#define BINSTRING(member) \
^
In file included from ass_cache.h:59:0,
from ass_font.h:58,
from ass_cache.c:28:
ass_cache_template.h:9:0: note: this is the location of the previous definition
#define BINSTRING(member) \
^
In file included from ass_cache.c:36:0:
ass_cache_template.h:30:0: warning: "BINSTRING" redefined
#define BINSTRING(member) \
^
In file included from ass_cache.c:34:0:
ass_cache_template.h:52:0: note: this is the location of the previous definition
#define BINSTRING(member) \
^
Oleg Oshmyan [Thu, 29 May 2014 23:01:41 +0000 (00:01 +0100)]
Use ass_drawing_add_chars for vector drawings
This not only provides a performance improvement but also
conveniently fixes the following issue: we used to interpret
backslash-escapes in vector drawings, but we shouldn't.
They can be used to force dialog text to use a specific ASS_Style. It
uses a fuzzy heuristic for that, and the quality of results may vary.
It does style overriding selectively and tries not to override things
that need explicit styling. The heuristic for that isn't set in stone
either, and can change with future libass versions.
wm4 [Sat, 31 May 2014 21:19:45 +0000 (23:19 +0200)]
Fix change detection when text is clipped to screen
The glyphs are clipped before combining, so the combined bitmap can
always have the same position, size, and address. This breaks the
change detection. Or at least I think that's what happens.
Grigori Goronzy [Thu, 29 May 2014 01:59:08 +0000 (03:59 +0200)]
shaper: add FriBidi error handling
It is unlikely, but FriBidi might not process a string correctly,
and we should handle that. Tested by making it fail always. This
should also fix some compiler warnings.
Oleg Oshmyan [Thu, 1 May 2014 01:38:33 +0000 (02:38 +0100)]
Reset clipping mode on every rectangle \clip
Prior to this fix, both of the following:
\iclip(0,0,9999,9999)\clip(0,0,9999,9999)
\iclip(0,0,0,0)\clip(0,0,9999,9999)
hid the whole picture in libass. The correct behavior
in both cases is to display the whole picture.