Commit 0f245966 authored by Timo Gurr's avatar Timo Gurr Committed by Torsten Rahn
Browse files

Fix build with OpenCV 4

parent 0d864e4b
......@@ -79,7 +79,7 @@ void interpolate( MarbleWidget* widget, qreal value )
void animatedFlight( MarbleWidget *mapWidget )
{
mapWidget->resize( frameSize.width, frameSize.height );
VideoWriter videoWriter( videoFile, CV_FOURCC('D','I','V','X'), fps, frameSize );
VideoWriter videoWriter( videoFile, cv::VideoWriter::fourcc('D','I','V','X'), fps, frameSize );
Mat buffer;
buffer.create(frameSize, CV_8UC3);
timeLine.setCurveShape( QTimeLine::EaseInOutCurve );
......@@ -91,7 +91,7 @@ void animatedFlight( MarbleWidget *mapWidget )
QImage screenshot = QPixmap::grabWidget( mapWidget ).toImage().convertToFormat( QImage::Format_RGB888 );
Mat converter( frameSize, CV_8UC3 );
converter.data = screenshot.bits();
cvtColor( converter, buffer, CV_RGB2BGR );
cvtColor( converter, buffer, COLOR_RGB2BGR );
videoWriter.write( buffer );
}
for ( int i=0; i<fps; ++i ) {
......
......@@ -112,7 +112,7 @@ void animatedFlight( MarbleWidget *mapWidget, GeoDataTour* tour )
double const shift = 1.0 / fps;
double const duration = playback->duration();
VideoWriter videoWriter( videoFile, CV_FOURCC('D','I','V','X'), fps, frameSize );
VideoWriter videoWriter( videoFile, cv::VideoWriter::fourcc('D','I','V','X'), fps, frameSize );
Mat buffer;
buffer.create(frameSize, CV_8UC3);
for ( double position = 0.0; position <= duration; position += shift ) {
......@@ -123,7 +123,7 @@ void animatedFlight( MarbleWidget *mapWidget, GeoDataTour* tour )
QImage screenshot = QPixmap::grabWidget( mapWidget ).toImage().convertToFormat( QImage::Format_RGB888 );
Mat converter( frameSize, CV_8UC3 );
converter.data = screenshot.bits();
cvtColor( converter, buffer, CV_RGB2BGR );
cvtColor( converter, buffer, COLOR_RGB2BGR );
videoWriter.write( buffer );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment