]> Creatis software - clitk.git/commitdiff
Added Windows avi possibility
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Thu, 22 Mar 2012 16:52:07 +0000 (17:52 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Thu, 22 Mar 2012 16:52:07 +0000 (17:52 +0100)
vv/vvMainWindow.cxx

index 0635d7bd7cc1fb94f17b170563cc4c7098af2b7b..986d7b93cfd76cbf727c716d5966250ae5da6a4d 100644 (file)
@@ -71,6 +71,9 @@
 #include <vtkPNGWriter.h>
 #include <vtkJPEGWriter.h>
 #include <vtkGenericMovieWriter.h>
+#ifdef VTK_USE_VIDEO_FOR_WINDOWS
+#  include <vtkAVIWriter.h>
+#endif
 #ifdef VTK_USE_FFMPEG_ENCODER
 #  include <vtkFFMPEGWriter.h>
 #endif
@@ -2776,6 +2779,19 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
 
     // Video
     vtkGenericMovieWriter *vidwriter = NULL;
+#ifdef VTK_USE_VIDEO_FOR_WINDOWS
+    if (!strcmp(ext, ".avi")) {
+      vtkAVIWriter *mpg = vtkAVIWriter::New();
+      vidwriter = mpg;
+      mpg->SetQuality(2);
+      bool ok;
+      int fps = QInputDialog::getInt(this, tr("Number of frames per second"),
+                                     tr("FPS:"), 5, 0, 1024, 1, &ok);
+      if(!ok)
+        fps = 5;
+      mpg->SetRate(fps);
+    }
+#endif
 #ifdef VTK_USE_FFMPEG_ENCODER
     if (!strcmp(ext, ".avi")) {
       vtkFFMPEGWriter *mpg = vtkFFMPEGWriter::New();