summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/avdevice/videoinput.cpp
blob: 5f0f8e5801822b7ee44591bd5f03f1537da50744 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
    videoinput.cpp  -  Kopete Video Input Class

    Copyright (c) 2005-2006 by Cláudio da Silveira Pinheiro   <taupter@gmail.com>

    Kopete    (c) 2002-2003      by the Kopete developers  <kopete-devel@kde.org>

    *************************************************************************
    *                                                                       *
    * This library is free software; you can redistribute it and/or         *
    * modify it under the terms of the GNU Lesser General Public            *
    * License as published by the Free Software Foundation; either          *
    * version 2 of the License, or (at your option) any later version.      *
    *                                                                       *
    *************************************************************************
*/

#include "videoinput.h"

namespace Kopete {

namespace AV {

VideoInput::VideoInput()
{
	kdDebug() << k_funcinfo << "Executing Video Input's constructor!!!" << endl;
	m_brightness = 0.5;
	m_contrast = 0.5;
	m_saturation = 0.5;
	m_hue = 0.5;
	m_autobrightnesscontrast = false;
	m_autocolorcorrection = false;
}


VideoInput::~VideoInput()
{
}

float VideoInput::getBrightness()
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	return m_brightness;
}

float VideoInput::setBrightness(float brightness)
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	if ( brightness > 1 )
		brightness = 1;
	else
	if ( brightness < 0 )
		brightness = 0;
	m_brightness = brightness;
	return getBrightness();
}

float VideoInput::getContrast()
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	return m_contrast;
}

float VideoInput::setContrast(float contrast)
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	if ( contrast > 1 )
		contrast = 1;
	else
	if ( contrast < 0 )
		contrast = 0;
	m_contrast = contrast;
	return getContrast();
}

float VideoInput::getSaturation()
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	return m_saturation;
}

float VideoInput::setSaturation(float saturation)
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	if ( saturation > 1 )
		saturation = 1;
	else
	if ( saturation < 0 )
		saturation = 0;
	m_saturation = saturation;
	return getSaturation();
}

float VideoInput::getWhiteness()
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	return m_whiteness;
}

float VideoInput::setWhiteness(float whiteness)
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	if ( whiteness > 1 )
		whiteness = 1;
	else
	if ( whiteness < 0 )
		whiteness = 0;
	m_whiteness = whiteness;
	return getWhiteness();
}

float VideoInput::getHue()
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	return m_hue;
}

float VideoInput::setHue(float hue)
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	if ( hue > 1 )
		hue = 1;
	else
	if ( hue < 0 )
		hue = 0;
	m_hue = hue;
	return getHue();
}


bool VideoInput::getAutoBrightnessContrast()
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	return m_autobrightnesscontrast;
}

bool VideoInput::setAutoBrightnessContrast(bool brightnesscontrast)
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	m_autobrightnesscontrast = brightnesscontrast;
	return getAutoBrightnessContrast();
}

bool VideoInput::getAutoColorCorrection()
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	return m_autocolorcorrection;
}

bool VideoInput::setAutoColorCorrection(bool colorcorrection)
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	m_autocolorcorrection = colorcorrection;
	return getAutoColorCorrection();
}

bool VideoInput::getImageAsMirror()
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	return m_imageasmirror;
}

bool VideoInput::setImageAsMirror(bool imageasmirror)
{
//	kdDebug() <<  k_funcinfo << " called." << endl;
	m_imageasmirror = imageasmirror;
	return getImageAsMirror();
}

}

}