-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjpeg_reader.cpp
More file actions
28 lines (23 loc) · 787 Bytes
/
Copy pathjpeg_reader.cpp
File metadata and controls
28 lines (23 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "vtkImageViewer2.h"
#include "vtkJPEGReader.h"
#include "vtkNew.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "platform.h"
#include <filesystem>
#include <string>
auto main(int argc, char** argv) -> int {
const auto file_name{
fs::current_path().append("Data/Infovis/Images/NE2_ps_bath.jpg").string()};
vtkNew<vtkJPEGReader> jpeg_reader;
jpeg_reader->SetFileName(file_name.c_str());
vtkNew<vtkImageViewer2> image_viewer;
image_viewer->SetInputConnection(jpeg_reader->GetOutputPort());
vtkNew<vtkRenderWindowInteractor> interactor;
image_viewer->SetupInteractor(interactor);
image_viewer->Render();
image_viewer->GetRenderer()->ResetCamera();
image_viewer->Render();
interactor->Start();
}