From 7a76b577d85ddc8f9e255b1a1c195ee88b76a7d8 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 6 Mar 2020 18:20:11 +0100 Subject: command: extend osd-overlay command with bounds reporting This is more or less a minimal hack to make _some_ text measurement functionality available to scripts. Since libass does not support such a thing, this simply uses the bounding box of the rendered text. This is far from ideal. Problems include: - using a bitmap bounding box - additional memory waste and/or flushing caches - dependency on window size - odd small deviations with different window sizes (run osd-test.lua and resize the window after each timer update; the bounding boxes aren't adjusted in an overly useful way) - inability to query the size _after_ actual rendering But I guess it's a start. Since I'm aware that it's crap, add a threat to the manpage that this may be changed/removed again. For now, I'm interested whether anyone will have use for it in its current form, as it's an often requested feature. --- sub/ass_mp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sub/ass_mp.h') diff --git a/sub/ass_mp.h b/sub/ass_mp.h index 4ebb7f39a6..f4488bf8c7 100644 --- a/sub/ass_mp.h +++ b/sub/ass_mp.h @@ -55,5 +55,7 @@ struct mp_ass_packer *mp_ass_packer_alloc(void *ta_parent); void mp_ass_packer_pack(struct mp_ass_packer *p, ASS_Image **image_lists, int num_image_lists, bool changed, int preferred_osd_format, struct sub_bitmaps *out); +void mp_ass_get_bb(ASS_Image *image_list, ASS_Track *track, + struct mp_osd_res *res, double *out_rc); #endif /* MPLAYER_ASS_MP_H */ -- cgit v1.2.3