ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
abstractimageprocessor.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <vtkImageGradient.h>
11 #include <vtkImageLaplacian.h>
12 #include <vtkJPEGReader.h>
13 
14 #include "../qPCL.h"
15 #include "signalledrunable.h"
16 
17 namespace VtkUtils {
18 
20 public:
22 
23  void setInputData(vtkImageData* input) { m_imageData = input; }
24  vtkImageData* inputData() const { return m_imageData; }
25 
26 protected:
27  vtkImageData* m_imageData = nullptr;
28 };
29 
30 template <class T>
32 public:
33  ImageProcessorTempl() { m_algorithm = T::New(); }
34 
35  T* algorithm() const { return m_algorithm; }
36 
37  void run() {
38  if (!m_imageData) {
39  emit finished();
40  return;
41  }
42 
43  m_algorithm->SetInputData(m_imageData);
44  m_algorithm->Update();
45  emit finished();
46  }
47 
48 protected:
49  T* m_algorithm = nullptr;
50 };
51 
52 } // namespace VtkUtils
void setInputData(vtkImageData *input)
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15