comparison mplayer.c @ 7517:9d433771b6d0

-vf eq2, LUT-based brightness/contrast/gamma correction (Y-only) by Hampa Hug <hhug@student.ethz.ch>
author arpi
date Fri, 27 Sep 2002 21:08:36 +0000
parents 657041b7236b
children aa1a1249f239
comparison
equal deleted inserted replaced
7516:657041b7236b 7517:9d433771b6d0
249 249
250 static demuxer_t *demuxer=NULL; 250 static demuxer_t *demuxer=NULL;
251 251
252 char* current_module=NULL; // for debugging 252 char* current_module=NULL; // for debugging
253 253
254 int vo_gamma_gamma = 1000;
254 int vo_gamma_brightness = 1000; 255 int vo_gamma_brightness = 1000;
255 int vo_gamma_contrast = 1000; 256 int vo_gamma_contrast = 1000;
256 int vo_gamma_saturation = 1000; 257 int vo_gamma_saturation = 1000;
257 int vo_gamma_hue = 1000; 258 int vo_gamma_hue = 1000;
258 259
1266 // ========== Init display (sh_video->disp_w*sh_video->disp_h/out_fmt) ============ 1267 // ========== Init display (sh_video->disp_w*sh_video->disp_h/out_fmt) ============
1267 1268
1268 current_module="init_vo"; 1269 current_module="init_vo";
1269 if (sh_video) 1270 if (sh_video)
1270 { 1271 {
1272 if (vo_gamma_gamma != 1000)
1273 set_video_colors (sh_video, "gamma", vo_gamma_gamma);
1271 if (vo_gamma_brightness != 1000) 1274 if (vo_gamma_brightness != 1000)
1272 set_video_colors(sh_video, "brightness", vo_gamma_brightness); 1275 set_video_colors(sh_video, "brightness", vo_gamma_brightness);
1273 if (vo_gamma_contrast != 1000) 1276 if (vo_gamma_contrast != 1000)
1274 set_video_colors(sh_video, "contrast", vo_gamma_contrast); 1277 set_video_colors(sh_video, "contrast", vo_gamma_contrast);
1275 if (vo_gamma_saturation != 1000) 1278 if (vo_gamma_saturation != 1000)
1983 play_tree_set_child(playtree,e); 1986 play_tree_set_child(playtree,e);
1984 play_tree_iter_step(playtree_iter,0,0); 1987 play_tree_iter_step(playtree_iter,0,0);
1985 eof = PT_NEXT_SRC; 1988 eof = PT_NEXT_SRC;
1986 } 1989 }
1987 } break; 1990 } break;
1991 case MP_CMD_GAMMA : {
1992 int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;
1993
1994 if (!sh_video)
1995 break;
1996
1997 if (vo_gamma_gamma == 1000)
1998 {
1999 vo_gamma_gamma = 0;
2000 get_video_colors (sh_video, "gamma", &vo_gamma_gamma);
2001 }
2002
2003 if (abs)
2004 vo_gamma_gamma = v;
2005 else
2006 vo_gamma_gamma += v;
2007
2008 if (vo_gamma_gamma > 100)
2009 vo_gamma_gamma = 100;
2010 else if (vo_gamma_gamma < -100)
2011 vo_gamma_gamma = -100;
2012 set_video_colors(sh_video, "gamma", vo_gamma_gamma);
2013 #ifdef USE_OSD
2014 if(osd_level){
2015 osd_visible=sh_video->fps; // 1 sec
2016 vo_osd_progbar_type=OSD_BRIGHTNESS;
2017 vo_osd_progbar_value=(vo_gamma_gamma<<7)/100 + 128;
2018 vo_osd_changed(OSDTYPE_PROGBAR);
2019 }
2020 #endif // USE_OSD
2021 } break;
1988 case MP_CMD_BRIGHTNESS : { 2022 case MP_CMD_BRIGHTNESS : {
1989 int v = cmd->args[0].v.i, abs = cmd->args[1].v.i; 2023 int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;
1990 2024
1991 if (!sh_video) 2025 if (!sh_video)
1992 break; 2026 break;