2012-09-28 19:38:52 +00:00
|
|
|
#ifndef MPLAYER_SUB_IMG_CONVERT_H
|
|
|
|
#define MPLAYER_SUB_IMG_CONVERT_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
struct osd_conv_cache;
|
|
|
|
struct sub_bitmaps;
|
2012-12-28 14:46:23 +00:00
|
|
|
struct mp_rect;
|
2012-09-28 19:38:52 +00:00
|
|
|
|
|
|
|
struct osd_conv_cache *osd_conv_cache_new(void);
|
|
|
|
|
|
|
|
// These functions convert from one OSD format to another. On success, they copy
|
|
|
|
// the converted image data into c, and change imgs to point to the data.
|
2012-10-04 15:16:47 +00:00
|
|
|
bool osd_conv_idx_to_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs);
|
2013-08-09 20:59:36 +00:00
|
|
|
bool osd_conv_idx_to_rgba_str(struct osd_conv_cache *c, struct sub_bitmaps *imgs);
|
2012-12-11 15:24:24 +00:00
|
|
|
bool osd_conv_ass_to_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs);
|
2013-08-09 20:59:36 +00:00
|
|
|
bool osd_conv_ass_to_rgba_str(struct osd_conv_cache *c, struct sub_bitmaps *imgs);
|
2012-11-25 22:32:35 +00:00
|
|
|
// Sub postprocessing
|
2012-11-24 23:06:16 +00:00
|
|
|
bool osd_conv_blur_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs,
|
|
|
|
double gblur);
|
2013-08-09 22:27:41 +00:00
|
|
|
bool osd_scale_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs);
|
2012-11-25 22:32:35 +00:00
|
|
|
bool osd_conv_idx_to_gray(struct osd_conv_cache *c, struct sub_bitmaps *imgs);
|
2012-09-28 19:38:52 +00:00
|
|
|
|
2012-12-28 14:46:23 +00:00
|
|
|
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);
|
|
|
|
|
2012-09-28 19:38:52 +00:00
|
|
|
#endif
|