summaryrefslogtreecommitdiffstats
path: root/libass/ass.h
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-07-21 03:06:05 +0200
committerGrigori Goronzy <greg@blackbox>2009-07-21 03:09:13 +0200
commita7b40ce5a9d84182b40392665d3a11a69be90ebf (patch)
treea27f02735c4d0e33ad39c85d5066fa2ec395ab3e /libass/ass.h
parentf7f50dfb6335b3d2c1f1fa85a1e496ed2abf6d27 (diff)
downloadlibass-a7b40ce5a9d84182b40392665d3a11a69be90ebf.tar.bz2
libass-a7b40ce5a9d84182b40392665d3a11a69be90ebf.tar.xz
Factor out bitmap buffer copy
For clarity, factor out bitmap copying into a function. Do not pad the bitmap with stride in the last row; this can not by guaranteed anyway. Add a comment about this peculiarity to the API documentation in ass.h Idea by Evgeniy Stepanov.
Diffstat (limited to 'libass/ass.h')
-rw-r--r--libass/ass.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/libass/ass.h b/libass/ass.h
index b92960a..3c8c1f6 100644
--- a/libass/ass.h
+++ b/libass/ass.h
@@ -30,11 +30,21 @@
/* Libass renderer object. Contents are private. */
typedef struct ass_renderer_s ass_renderer_t;
-/* A linked list of images produced by ass renderer. */
+/*
+ * A linked list of images produced by an ass renderer.
+ *
+ * These images have to be rendered in-order for the correct screen
+ * composition. The libass renderer clips these bitmaps to the frame size.
+ * w/h can be zero, in this case the bitmap should not be rendered at all.
+ * The last bitmap row is not guaranteed to be padded up to stride size,
+ * e.g. in the worst case a bitmap has the size stride * (h - 1) + w.
+ */
typedef struct ass_image_s {
int w, h; // Bitmap width/height
int stride; // Bitmap stride
unsigned char *bitmap; // 1bpp stride*h alpha buffer
+ // Note: the last row may not be padded to
+ // bitmap stride!
uint32_t color; // Bitmap color and alpha, RGBA
int dst_x, dst_y; // Bitmap placement inside the video frame