vtkImageBlend.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00088 #ifndef __vtkImageBlend_h
00089 #define __vtkImageBlend_h
00090
00091
00092 #include "vtkImageMultipleInputFilter.h"
00093
00094 class vtkImageStencilData;
00095
00096 #define VTK_IMAGE_BLEND_MODE_NORMAL 0
00097 #define VTK_IMAGE_BLEND_MODE_COMPOUND 1
00098
00099 class VTK_IMAGING_EXPORT vtkImageBlend : public vtkImageMultipleInputFilter
00100 {
00101 public:
00102 static vtkImageBlend *New();
00103 vtkTypeRevisionMacro(vtkImageBlend,vtkImageMultipleInputFilter);
00104 void PrintSelf(ostream& os, vtkIndent indent);
00105
00107
00109 void SetOpacity(int idx, double opacity);
00110 double GetOpacity(int idx);
00112
00114
00115 virtual void SetStencil(vtkImageStencilData*);
00116 vtkGetObjectMacro(Stencil, vtkImageStencilData);
00118
00120
00121 vtkSetClampMacro(BlendMode,int,
00122 VTK_IMAGE_BLEND_MODE_NORMAL,
00123 VTK_IMAGE_BLEND_MODE_COMPOUND );
00124 vtkGetMacro(BlendMode,int);
00125 void SetBlendModeToNormal()
00126 {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_NORMAL);};
00127 void SetBlendModeToCompound()
00128 {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_COMPOUND);};
00129 const char *GetBlendModeAsString(void);
00131
00133
00135 vtkSetMacro(CompoundThreshold,double);
00136 vtkGetMacro(CompoundThreshold,double);
00138
00139 protected:
00140 vtkImageBlend();
00141 ~vtkImageBlend();
00142
00143 void ComputeInputUpdateExtent(int inExt[6], int outExt[6],
00144 int whichInput);
00145
00146 void ExecuteInformation() {
00147 this->vtkImageMultipleInputFilter::ExecuteInformation(); };
00148
00149 void ExecuteInformation(vtkImageData **, vtkImageData *);
00150
00151 void ThreadedExecute(vtkImageData **inDatas,
00152 vtkImageData *outData,
00153 int extent[6],
00154 int id);
00155
00156 void ExecuteData(vtkDataObject *output);
00157
00158 vtkImageStencilData *Stencil;
00159 double *Opacity;
00160 int OpacityArrayLength;
00161 int BlendMode;
00162 double CompoundThreshold;
00163 int DataWasPassed;
00164 private:
00165 vtkImageBlend(const vtkImageBlend&);
00166 void operator=(const vtkImageBlend&);
00167 };
00168
00170 inline const char *vtkImageBlend::GetBlendModeAsString()
00171 {
00172 switch (this->BlendMode)
00173 {
00174 case VTK_IMAGE_BLEND_MODE_NORMAL:
00175 return "Normal";
00176 case VTK_IMAGE_BLEND_MODE_COMPOUND:
00177 return "Compound";
00178 default:
00179 return "Unknown Blend Mode";
00180 }
00181 }
00182
00183
00184 #endif
00185
00186
00187
00188