diff options
author | Dr.Smile <vabnick@gmail.com> | 2015-01-23 06:32:16 +0300 |
---|---|---|
committer | Dr.Smile <vabnick@gmail.com> | 2015-01-28 02:43:47 +0300 |
commit | b63d8931845af256523d1142abea5caf2f65685d (patch) | |
tree | bc71c7904e56d23dfa6e8022a6eee29437d1c799 /libass/ass_cache.h | |
parent | 1c4459b7d88f231fb832682d0a4e25888e8c12ee (diff) | |
download | libass-b63d8931845af256523d1142abea5caf2f65685d.tar.bz2 libass-b63d8931845af256523d1142abea5caf2f65685d.tar.xz |
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.
Fixes #153.
Fixes #82.
Diffstat (limited to 'libass/ass_cache.h')
-rw-r--r-- | libass/ass_cache.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libass/ass_cache.h b/libass/ass_cache.h index 06001423..af814ac3 100644 --- a/libass/ass_cache.h +++ b/libass/ass_cache.h @@ -31,14 +31,12 @@ typedef struct cache Cache; typedef struct { Bitmap *bm; // the actual bitmaps Bitmap *bm_o; - Bitmap *bm_s; } BitmapHashValue; typedef struct { Bitmap *bm; Bitmap *bm_o; Bitmap *bm_s; - FT_Vector pos; } CompositeHashValue; typedef struct { @@ -87,6 +85,24 @@ typedef struct bitmap_hash_key { } u; } BitmapHashKey; +typedef struct { + BitmapHashValue *image; + int x, y; +} BitmapRef; + +enum { + FILTER_BORDER_STYLE_3 = 1, + FILTER_NONZERO_BORDER = 2, + FILTER_NONZERO_SHADOW = 4, + FILTER_DRAW_SHADOW = 8, // VSFilter compatibility +}; + +typedef struct { + FilterDesc filter; + size_t bitmap_count; + BitmapRef *bitmaps; +} CompositeHashKey; + Cache *ass_cache_create(HashFunction hash_func, HashCompare compare_func, CacheItemDestructor destruct_func, ItemSize size_func, size_t key_size, size_t value_size); |