summaryrefslogtreecommitdiffstats
path: root/sub/sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-25 23:32:35 +0100
committerwm4 <wm4@nowhere>2012-11-25 23:40:07 +0100
commit5d5ddb2ad00a13e719585cefbbb59fa307fa2f73 (patch)
tree51c67ee2f25cefbd09bbcb4275e4a3d5ee7a74ac /sub/sub.c
parent24bfa82a91a49b0e2a120b719a6b89ac2b1b415b (diff)
downloadmpv-5d5ddb2ad00a13e719585cefbbb59fa307fa2f73.tar.bz2
mpv-5d5ddb2ad00a13e719585cefbbb59fa307fa2f73.tar.xz
sub: add --sub-gray option to display image subs in grayscale
MPlayer/mplayer2 still show DVD subtitles in gray. Depending on who you ask, this can be considered a bug or a feature. Include rendering in gray as explicit feature, so the user can decide what is better. This affects all indexed sub bitmaps entering the OSD rendering path. Currently, this means all image subs are affected by this option, but nothing else.
Diffstat (limited to 'sub/sub.c')
-rw-r--r--sub/sub.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sub/sub.c b/sub/sub.c
index 66ee6ea42c..0dae442aee 100644
--- a/sub/sub.c
+++ b/sub/sub.c
@@ -221,11 +221,14 @@ static void render_object(struct osd_state *osd, struct osd_object *obj,
bool cached = false; // do we have a copy of all the image data?
+ if (out_imgs->format == SUBBITMAP_INDEXED && opts->sub_gray)
+ cached |= osd_conv_idx_to_gray(obj->cache[0], out_imgs);
+
if (formats[SUBBITMAP_RGBA] && out_imgs->format == SUBBITMAP_INDEXED)
- cached |= osd_conv_idx_to_rgba(obj->cache[0], out_imgs);
+ cached |= osd_conv_idx_to_rgba(obj->cache[1], out_imgs);
if (out_imgs->format == SUBBITMAP_RGBA && opts->sub_gauss != 0.0f)
- cached |= osd_conv_blur_rgba(obj->cache[1], out_imgs, opts->sub_gauss);
+ cached |= osd_conv_blur_rgba(obj->cache[2], out_imgs, opts->sub_gauss);
if (cached)
obj->cached = *out_imgs;