]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/ImageBlender.h
yet another refactoring
[cpPlugins.git] / lib / cpExtensions / Algorithms / ImageBlender.h
diff --git a/lib/cpExtensions/Algorithms/ImageBlender.h b/lib/cpExtensions/Algorithms/ImageBlender.h
new file mode 100644 (file)
index 0000000..4d82bcf
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef __cpExtensions__Algorithms__ImageBlender__h__
+#define __cpExtensions__Algorithms__ImageBlender__h__
+
+#include <cpExtensions/Config.h>
+#include <vtkThreadedImageAlgorithm.h>
+#include <vector>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     * @note: Based on vtkImageWeightedSum
+     */
+    class cpExtensions_EXPORT ImageBlender
+      : public vtkThreadedImageAlgorithm
+    {
+    public:
+      typedef ImageBlender Self;
+      vtkTypeMacro( ImageBlender, vtkThreadedImageAlgorithm );
+
+    public:
+      static Self* New( );
+
+      unsigned int GetNumberOfInputs( );
+
+    protected:
+      ImageBlender( );
+      virtual ~ImageBlender( );
+
+      int RequestInformation(
+        vtkInformation* request,
+        vtkInformationVector** inputVector,
+        vtkInformationVector* outputVector
+        );
+      int RequestData(
+        vtkInformation* request,
+        vtkInformationVector** inputVector,
+        vtkInformationVector* outputVector
+        );
+      void ThreadedRequestData(
+        vtkInformation* request,
+        vtkInformationVector** inputVector,
+        vtkInformationVector* outputVector,
+        vtkImageData*** inData, vtkImageData** outData,
+        int outExt[ 6 ], int id
+        );
+      int FillInputPortInformation( int i, vtkInformation* info );
+
+    private:
+      // Purposely not implemented.
+      ImageBlender( const Self& other );
+      void operator=( const Self& other );
+
+    protected:
+      std::vector< double > m_Ranges;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __cpExtensions__Algorithms__ImageBlender__h__
+
+// eof - $RCSfile$