support for gamma and sharpness/acutance controls.

also from Martin Pieuchot, thanks!
This commit is contained in:
jakemsr 2010-09-26 23:47:17 +00:00
parent c83513fd2c
commit 52f69c164d
2 changed files with 38 additions and 5 deletions

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: video.1,v 1.3 2010/07/26 23:02:06 jakemsr Exp $
.\" $OpenBSD: video.1,v 1.4 2010/09/26 23:47:17 jakemsr Exp $
.\"
.\" Copyright (c) 2010 Jacob Meuser <jakemsr@openbsd.org>
.\"
@ -15,7 +15,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\"
.Dd $Mdocdate: July 26 2010 $
.Dd $Mdocdate: September 26 2010 $
.Dt VIDEO 1
.Os
.Sh NAME
@ -66,7 +66,8 @@ written to
.Ar output
and displayed via
.Xr Xv 3 .
The brightness, contrast, gain, hue and saturation controls of
The acutance, brightness, contrast, gain, gamma, hue and saturation
controls of
.Ar file
can also be adjusted if
.Ar file
@ -215,6 +216,12 @@ the following signals: SIGHUP, SIGINT, SIGKILL, SIGTERM, SIGPIPE.
responds to certain key presses while it is displaying frames.
The keypresses are as follows:
.Bl -tag -width "aXX"
.It Ic A
Increase acutance (sharpness) control of
.Ar file .
.It Ic a
Decrease acutance (sharpness) control of
.Ar file .
.It Ic B
Increase brightness control of
.Ar file .
@ -241,6 +248,12 @@ Increase hue control of
.It Ic h
Decrease hue control of
.Ar file .
.It Ic M
Increase gamma control of
.Ar file .
.It Ic m
Decrease gamma control of
.Ar file .
.It Ic p
Toggle new frame display.
.It Ic q

View File

@ -1,4 +1,4 @@
/* $OpenBSD: video.c,v 1.5 2010/09/13 01:35:50 jakemsr Exp $ */
/* $OpenBSD: video.c,v 1.6 2010/09/26 23:47:17 jakemsr Exp $ */
/*
* Copyright (c) 2010 Jacob Meuser <jakemsr@openbsd.org>
*
@ -96,7 +96,11 @@ struct dev_ctrls {
{ "hue", 0, V4L2_CID_HUE, 0, 0, 0, 0, 0 },
#define CTRL_GAIN 4
{ "gain", 0, V4L2_CID_GAIN, 0, 0, 0, 0, 0 },
#define CTRL_LAST 5
#define CTRL_GAMMA 5
{ "gamma", 0, V4L2_CID_GAMMA, 0, 0, 0, 0, 0 },
#define CTRL_SHARPNESS 6
{ "sharpness", 0, V4L2_CID_SHARPNESS, 0, 0, 0, 0, 0 },
#define CTRL_LAST 7
{ NULL, 0, 0, 0, 0, 0, 0, 0 }
};
@ -538,6 +542,14 @@ display_event(struct video *vid)
warnx("got KeyPress event");
XLookupString(&x->event.xkey, &str, 1, NULL, NULL);
switch (str) {
case 'A':
if (vid->mode & M_IN_DEV)
dev_set_ctrl(vid, CTRL_SHARPNESS, 1);
break;
case 'a':
if (vid->mode & M_IN_DEV)
dev_set_ctrl(vid, CTRL_SHARPNESS, -1);
break;
case 'B':
if (vid->mode & M_IN_DEV)
dev_set_ctrl(vid, CTRL_BRIGHTNESS, 1);
@ -583,6 +595,14 @@ display_event(struct video *vid)
fprintf(stderr, "stopping output\n");
wout = 0;
break;
case 'M':
if (vid->mode & M_IN_DEV)
dev_set_ctrl(vid, CTRL_GAMMA, 1);
break;
case 'm':
if (vid->mode & M_IN_DEV)
dev_set_ctrl(vid, CTRL_GAMMA, -1);
break;
case 'p':
hold = !hold;
break;