00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00096 #ifndef __vtkImageBlend_h
00097 #define __vtkImageBlend_h
00098
00099
00100 #include "vtkImageMultipleInputFilter.h"
00101
00102 #define VTK_IMAGE_BLEND_MODE_NORMAL 0
00103 #define VTK_IMAGE_BLEND_MODE_COMPOUND 1
00104
00105 class VTK_EXPORT vtkImageBlend : public vtkImageMultipleInputFilter
00106 {
00107 public:
00108 static vtkImageBlend *New();
00109 vtkTypeMacro(vtkImageBlend,vtkImageMultipleInputFilter);
00110 void PrintSelf(ostream& os, vtkIndent indent);
00111
00114 void SetOpacity(int idx, double opacity);
00115 double GetOpacity(int idx);
00116
00118 vtkSetClampMacro(BlendMode,int,
00119 VTK_IMAGE_BLEND_MODE_NORMAL,
00120 VTK_IMAGE_BLEND_MODE_COMPOUND );
00121 vtkGetMacro(BlendMode,int);
00122 void SetBlendModeToNormal()
00123 {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_NORMAL);};
00124 void SetBlendModeToCompound()
00125 {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_COMPOUND);};
00126 const char *GetBlendModeAsString(void);
00127
00130 vtkSetMacro(CompoundThreshold,float);
00131 vtkGetMacro(CompoundThreshold,float);
00132
00133 virtual void UpdateData(vtkDataObject *output);
00134
00135 protected:
00136 vtkImageBlend();
00137 ~vtkImageBlend();
00138 vtkImageBlend(const vtkImageBlend&) {};
00139 void operator=(const vtkImageBlend&) {};
00140
00141 void ComputeInputUpdateExtent(int inExt[6], int outExt[6],
00142 int whichInput);
00143
00144 void ThreadedExecute(vtkImageData **inDatas,
00145 vtkImageData *outData,
00146 int extent[6],
00147 int id);
00148
00149 double *Opacity;
00150 int OpacityArrayLength;
00151 int BlendMode;
00152 float CompoundThreshold;
00153 };
00154
00156 inline const char *vtkImageBlend::GetBlendModeAsString()
00157 {
00158 switch (this->BlendMode)
00159 {
00160 case VTK_IMAGE_BLEND_MODE_NORMAL:
00161 return "Normal";
00162 case VTK_IMAGE_BLEND_MODE_COMPOUND:
00163 return "Compound";
00164 default:
00165 return "Unknown Blend Mode";
00166 }
00167 }
00168
00169
00170 #endif
00171
00172
00173
00174