[Mplayer-cvslog] CVS: main mplayer.c,1.576,1.577
Arpi of Ize
arpi at mplayerhq.hu
Fri Sep 27 23:08:50 CEST 2002
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv21148
Modified Files:
mplayer.c
Log Message:
-vf eq2, LUT-based brightness/contrast/gamma correction (Y-only)
by Hampa Hug <hhug at student.ethz.ch>
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.576
retrieving revision 1.577
diff -u -r1.576 -r1.577
--- mplayer.c 27 Sep 2002 20:57:00 -0000 1.576
+++ mplayer.c 27 Sep 2002 21:06:51 -0000 1.577
@@ -251,6 +251,7 @@
char* current_module=NULL; // for debugging
+int vo_gamma_gamma = 1000;
int vo_gamma_brightness = 1000;
int vo_gamma_contrast = 1000;
int vo_gamma_saturation = 1000;
@@ -1268,6 +1269,8 @@
current_module="init_vo";
if (sh_video)
{
+ if (vo_gamma_gamma != 1000)
+ set_video_colors (sh_video, "gamma", vo_gamma_gamma);
if (vo_gamma_brightness != 1000)
set_video_colors(sh_video, "brightness", vo_gamma_brightness);
if (vo_gamma_contrast != 1000)
@@ -1984,6 +1987,37 @@
play_tree_iter_step(playtree_iter,0,0);
eof = PT_NEXT_SRC;
}
+ } break;
+ case MP_CMD_GAMMA : {
+ int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;
+
+ if (!sh_video)
+ break;
+
+ if (vo_gamma_gamma == 1000)
+ {
+ vo_gamma_gamma = 0;
+ get_video_colors (sh_video, "gamma", &vo_gamma_gamma);
+ }
+
+ if (abs)
+ vo_gamma_gamma = v;
+ else
+ vo_gamma_gamma += v;
+
+ if (vo_gamma_gamma > 100)
+ vo_gamma_gamma = 100;
+ else if (vo_gamma_gamma < -100)
+ vo_gamma_gamma = -100;
+ set_video_colors(sh_video, "gamma", vo_gamma_gamma);
+#ifdef USE_OSD
+ if(osd_level){
+ osd_visible=sh_video->fps; // 1 sec
+ vo_osd_progbar_type=OSD_BRIGHTNESS;
+ vo_osd_progbar_value=(vo_gamma_gamma<<7)/100 + 128;
+ vo_osd_changed(OSDTYPE_PROGBAR);
+ }
+#endif // USE_OSD
} break;
case MP_CMD_BRIGHTNESS : {
int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;
More information about the MPlayer-cvslog
mailing list