summaryrefslogtreecommitdiffstats
path: root/sub/sub.c
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/sub.c
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/sub.c')
-rw-r--r--sub/sub.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/sub/sub.c b/sub/sub.c
index ea9c51a758..b01493a790 100644
--- a/sub/sub.c
+++ b/sub/sub.c
@@ -333,23 +333,3 @@ void osd_subs_changed(struct osd_state *osd)
vo_osd_changed(n);
}
}
-
-bool sub_bitmaps_bb(struct sub_bitmaps *imgs, struct mp_rect *out_bb)
-{
- struct mp_rect bb = {INT_MAX, INT_MAX, INT_MIN, INT_MIN};
- for (int n = 0; n < imgs->num_parts; n++) {
- struct sub_bitmap *p = &imgs->parts[n];
- bb.x0 = FFMIN(bb.x0, p->x);
- bb.y0 = FFMIN(bb.y0, p->y);
- bb.x1 = FFMAX(bb.x1, p->x + p->dw);
- bb.y1 = FFMAX(bb.y1, p->y + p->dh);
- }
-
- // avoid degenerate bounding box if empty
- bb.x0 = FFMIN(bb.x0, bb.x1);
- bb.y0 = FFMIN(bb.y0, bb.y1);
-
- *out_bb = bb;
-
- return bb.x0 < bb.x1 && bb.y0 < bb.y1;
-}