19 #ifndef vtkCaptureScreen_h
20 #define vtkCaptureScreen_h
23 #include "vtkSmartPointer.h"
24 #include "vtkWindowToImageFilter.h"
25 #include "vtkRenderWindow.h"
27 template <
typename TImageWriter>
49 operator()(vtkRenderWindow * iRenderer,
const std::string & iFileName)
59 Capture(vtkRenderWindow * iRenderer,
const std::string & iFileName)
const
63 vtkSmartPointer<vtkWindowToImageFilter> Dumper = vtkSmartPointer<vtkWindowToImageFilter>::New();
64 Dumper->SetInput(iRenderer);
67 vtkSmartPointer<ImageWriterType> writer = vtkSmartPointer<ImageWriterType>::New();
68 writer->SetFileName(iFileName.c_str());
69 writer->SetInputConnection(Dumper->GetOutputPort());