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
|
#include "VideoDeviceOptions.h"
static const char *option[][2] = {
{ "width", "176" },
{ "height", "144" },
{ "framerate", "10" },
{ "brightness", "32768" },
{ "contrast", "32768" },
{ "saturation", "32768" },
{ "gamma", "32768" },
{ "hue", "32768" },
{ 0, 0 }
};
CVideoDeviceOptions::CVideoDeviceOptions()
{
DeclareVariables();
}
CVideoDeviceOptions::~CVideoDeviceOptions()
{
}
void CVideoDeviceOptions::DeclareVariables()
{
int i;
for (i = 0; option[i][0] != 0; i++)
DeclareVariable(option[i][0], option[i][1]);
}
QSize CVideoDeviceOptions::GetSize() const
{
int w, h;
w = GetInt("width");
h = GetInt("height");
return QSize(w, h);
}
void CVideoDeviceOptions::SetSize(const QSize &size)
{
Set("width", size.width());
Set("height", size.height());
}
int CVideoDeviceOptions::GetFramerate() const
{
return GetInt(option[2][0]);
}
void CVideoDeviceOptions::SetFramerate(int fps)
{
Set(option[2][0], fps);
}
int CVideoDeviceOptions::GetBrightness() const
{
return GetInt(option[3][0]);
}
void CVideoDeviceOptions::SetBrightness(int b)
{
Set(option[3][0], b);
}
int CVideoDeviceOptions::GetContrast() const
{
return GetInt(option[4][0]);
}
void CVideoDeviceOptions::SetContrast(int c)
{
Set(option[4][0], c);
}
int CVideoDeviceOptions::GetGamma() const
{
return GetInt(option[5][0]);
}
void CVideoDeviceOptions::SetGamma(int g)
{
Set(option[5][0], g);
}
int CVideoDeviceOptions::GetSaturation() const
{
return GetInt(option[6][0]);
}
void CVideoDeviceOptions::SetSaturation(int s)
{
Set(option[6][0], s);
}
int CVideoDeviceOptions::GetHue() const
{
return GetInt(option[7][0]);
}
void CVideoDeviceOptions::SetHue(int h)
{
Set(option[7][0], h);
}
|