Skip to content

Commit

Permalink
fix(tier4_screen_capture_rviz_plugin): fix spell check (autowarefound…
Browse files Browse the repository at this point in the history
…ation#1790)

* fix(tier4_screen_capture_rviz_plugin): fix spell check

Signed-off-by: h-ohta <hiroki.ota@tier4.jp>

* ci(pre-commit): autofix

Signed-off-by: h-ohta <hiroki.ota@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and boyali committed Oct 3, 2022
1 parent 82cdd27 commit 4a2b2e6
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ void AutowareScreenCapturePanel::onClickVideoCapture()
{
int fourcc = cv::VideoWriter::fourcc('h', '2', '6', '4'); // mp4
QScreen * screen = QGuiApplication::primaryScreen();
const auto qsize = screen->grabWindow(main_window_->winId())
.toImage()
.convertToFormat(QImage::Format_RGB888)
.rgbSwapped()
.size();
current_movie_size_ = cv::Size(qsize.width(), qsize.height());
const auto q_size = screen->grabWindow(main_window_->winId())
.toImage()
.convertToFormat(QImage::Format_RGB888)
.rgbSwapped()
.size();
current_movie_size_ = cv::Size(q_size.width(), q_size.height());
writer_.open(
"capture/" + capture_file_name_ + ".mp4", fourcc, capture_hz_->value(),
current_movie_size_);
Expand All @@ -160,12 +160,14 @@ void AutowareScreenCapturePanel::onTimer()
// this is deprecated but only way to capture nicely
QScreen * screen = QGuiApplication::primaryScreen();
QPixmap original_pixmap = screen->grabWindow(main_window_->winId());
const auto qimage = original_pixmap.toImage().convertToFormat(QImage::Format_RGB888).rgbSwapped();
const int h = qimage.height();
const int w = qimage.width();
const auto q_image =
original_pixmap.toImage().convertToFormat(QImage::Format_RGB888).rgbSwapped();
const int h = q_image.height();
const int w = q_image.width();
cv::Size size = cv::Size(w, h);
cv::Mat image(
size, CV_8UC3, const_cast<uchar *>(qimage.bits()), static_cast<size_t>(qimage.bytesPerLine()));
size, CV_8UC3, const_cast<uchar *>(q_image.bits()),
static_cast<size_t>(q_image.bytesPerLine()));
if (size != current_movie_size_) {
cv::Mat new_image;
cv::resize(image, new_image, current_movie_size_);
Expand Down

0 comments on commit 4a2b2e6

Please sign in to comment.