diff options
Diffstat (limited to 'sub/sub.c')
-rw-r--r-- | sub/sub.c | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -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; -} |