summaryrefslogtreecommitdiffhomepage
path: root/cv/video-widget.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-20 19:05:44 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-12-24 19:31:24 +0100
commite202dab212ef8fd284d2745dd66496dcc3a2043e (patch)
tree345437664c02e65f4b6f3b0dd960d20fd5c2bf58 /cv/video-widget.cpp
parent48de00ec978261c25e9c4a59479f0607cae751ff (diff)
fix undefined behavior undescore prefixes
Diffstat (limited to 'cv/video-widget.cpp')
-rw-r--r--cv/video-widget.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/cv/video-widget.cpp b/cv/video-widget.cpp
index c80bd96b..e7df087e 100644
--- a/cv/video-widget.cpp
+++ b/cv/video-widget.cpp
@@ -29,29 +29,29 @@ void cv_video_widget::update_image(const cv::Mat& frame)
if (width < 1 || height < 1)
return;
- if (_frame.cols != frame.cols || _frame.rows != frame.rows)
- _frame = cv::Mat(frame.rows, frame.cols, CV_8UC3);
- frame.copyTo(_frame);
+ if (frame1.cols != frame.cols || frame1.rows != frame.rows)
+ frame1 = cv::Mat(frame.rows, frame.cols, CV_8UC3);
+ frame.copyTo(frame1);
freshp = true;
- if (_frame2.cols != _frame.cols || _frame2.rows != _frame.rows)
- _frame2 = cv::Mat(_frame.rows, _frame.cols, CV_8UC4);
+ if (frame2.cols != frame1.cols || frame2.rows != frame1.rows)
+ frame2 = cv::Mat(frame1.rows, frame1.cols, CV_8UC4);
- if (_frame3.cols != width || _frame3.rows != height)
- _frame3 = cv::Mat(height, width, CV_8UC4);
+ if (frame3.cols != width || frame3.rows != height)
+ frame3 = cv::Mat(height, width, CV_8UC4);
- cv::cvtColor(_frame, _frame2, cv::COLOR_BGR2BGRA);
+ cv::cvtColor(frame1, frame2, cv::COLOR_BGR2BGRA);
const cv::Mat* img;
- if (_frame.cols != width || _frame.rows != height)
+ if (frame1.cols != width || frame1.rows != height)
{
- cv::resize(_frame2, _frame3, cv::Size(width, height), 0, 0, cv::INTER_NEAREST);
+ cv::resize(frame2, frame3, cv::Size(width, height), 0, 0, cv::INTER_NEAREST);
- img = &_frame3;
+ img = &frame3;
}
else
- img = &_frame2;
+ img = &frame2;
const unsigned nbytes = unsigned(4 * img->rows * img->cols);
@@ -101,9 +101,9 @@ void cv_video_widget::paintEvent(QPaintEvent*)
width = W, height = H;
- _frame = cv::Mat();
- _frame2 = cv::Mat();
- _frame3 = cv::Mat();
+ frame1 = cv::Mat();
+ frame2 = cv::Mat();
+ frame3 = cv::Mat();
}
}