aboutsummaryrefslogtreecommitdiffstats
path: root/utils/qv4l2/capture-win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/qv4l2/capture-win.cpp')
-rw-r--r--utils/qv4l2/capture-win.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/qv4l2/capture-win.cpp b/utils/qv4l2/capture-win.cpp
index 3437cf1a..d388b03f 100644
--- a/utils/qv4l2/capture-win.cpp
+++ b/utils/qv4l2/capture-win.cpp
@@ -26,6 +26,8 @@
#include <QApplication>
#include <QDesktopWidget>
+#include <math.h>
+
#define MIN_WIN_SIZE_WIDTH 160
#define MIN_WIN_SIZE_HEIGHT 120
@@ -281,6 +283,28 @@ void CaptureWin::setPixelAspectRatio(double ratio)
resetSize();
}
+float CaptureWin::getHorScaleFactor()
+{
+ float ow, sw, wscale;
+
+ sw = m_scaledSize.width();
+ ow = m_origFrameSize.width();
+ wscale = floor(100 * (sw / ow)) / 100.0;
+
+ return wscale;
+}
+
+float CaptureWin::getVertScaleFactor()
+{
+ float oh, sh, hscale;
+
+ sh = m_scaledSize.height();
+ oh = m_origFrameSize.height();
+ hscale = floor(100 * (sh / oh)) / 100.0;
+
+ return hscale;
+}
+
void CaptureWin::mouseDoubleClickEvent(QMouseEvent *e)
{
m_appWin->m_makeFullScreenAct->toggle();

Privacy Policy