summaryrefslogtreecommitdiffstats
path: root/sub/img_convert.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-28 15:46:23 +0100
committerwm4 <wm4@nowhere>2013-01-13 20:04:16 +0100
commit03730e73dc0439e0e673857d8c376a70cfcc8152 (patch)
tree8a9ba499fe0eed108eac7d17904eab8682735de4 /sub/img_convert.h
parent23f731839a39583321e2e03ff54715e9d5cea577 (diff)
downloadmpv-03730e73dc0439e0e673857d8c376a70cfcc8152.tar.bz2
mpv-03730e73dc0439e0e673857d8c376a70cfcc8152.tar.xz
img_convert: add sub_bitmap bounding box functions
mp_sub_bitmaps_bb is just sub_bitmaps_bb renamed/moved.
Diffstat (limited to 'sub/img_convert.h')
-rw-r--r--sub/img_convert.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sub/img_convert.h b/sub/img_convert.h
index 0a46916f60..383a2c8003 100644
--- a/sub/img_convert.h
+++ b/sub/img_convert.h
@@ -5,6 +5,7 @@
struct osd_conv_cache;
struct sub_bitmaps;
+struct mp_rect;
struct osd_conv_cache *osd_conv_cache_new(void);
@@ -17,4 +18,15 @@ bool osd_conv_blur_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs,
double gblur);
bool osd_conv_idx_to_gray(struct osd_conv_cache *c, struct sub_bitmaps *imgs);
+
+bool mp_sub_bitmaps_bb(struct sub_bitmaps *imgs, struct mp_rect *out_bb);
+
+// Intentionally limit the maximum number of bounding rects to something low.
+// This prevents the algorithm from degrading to O(N^2).
+// Most subtitles yield a very low number of bounding rects (<5).
+#define MP_SUB_BB_LIST_MAX 15
+
+int mp_get_sub_bb_list(struct sub_bitmaps *sbs, struct mp_rect *out_rc_list,
+ int rc_list_count);
+
#endif