diff options
author | Dr.Smile <vabnick@gmail.com> | 2018-05-03 03:09:52 +0300 |
---|---|---|
committer | Dr.Smile <vabnick@gmail.com> | 2019-05-20 01:01:40 +0300 |
commit | 4293dc36c1fc3a39731e328ab76af920512c888f (patch) | |
tree | 044859400d0135018283eac81bf5cee07ab1b685 /libass/ass_bitmap.h | |
parent | 2beae658967f44c51e272749fd8811b9569d41ac (diff) | |
download | libass-4293dc36c1fc3a39731e328ab76af920512c888f.tar.bz2 libass-4293dc36c1fc3a39731e328ab76af920512c888f.tar.xz |
bitmap: remove level of indirection in bitmap functions
This allows to use Bitmap struct directly as cache value
and to remove bunch of unnecessary allocations.
Diffstat (limited to 'libass/ass_bitmap.h')
-rw-r--r-- | libass/ass_bitmap.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libass/ass_bitmap.h b/libass/ass_bitmap.h index 8df445c..e3efbf7 100644 --- a/libass/ass_bitmap.h +++ b/libass/ass_bitmap.h @@ -96,14 +96,13 @@ typedef struct { uint8_t *buffer; // h * stride buffer } Bitmap; -Bitmap *alloc_bitmap(const BitmapEngine *engine, int32_t w, int32_t h, bool zero); +bool alloc_bitmap(const BitmapEngine *engine, Bitmap *bm, int32_t w, int32_t h, bool zero); bool realloc_bitmap(const BitmapEngine *engine, Bitmap *bm, int32_t w, int32_t h); -Bitmap *copy_bitmap(const BitmapEngine *engine, const Bitmap *src); +bool copy_bitmap(const BitmapEngine *engine, Bitmap *dst, const Bitmap *src); void ass_free_bitmap(Bitmap *bm); -Bitmap *outline_to_bitmap(ASS_Renderer *render_priv, - ASS_Outline *outline1, ASS_Outline *outline2, - int bord); +bool outline_to_bitmap(ASS_Renderer *render_priv, Bitmap *bm, + ASS_Outline *outline1, ASS_Outline *outline2); void ass_synth_blur(const BitmapEngine *engine, int opaque_box, int be, double blur_radius, Bitmap *bm_g, Bitmap *bm_o); |