VTK
vtkImageBlend.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageBlend.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
76 #ifndef vtkImageBlend_h
77 #define vtkImageBlend_h
78 
79 
80 #include "vtkImagingCoreModule.h" // For export macro
82 
84 
85 #define VTK_IMAGE_BLEND_MODE_NORMAL 0
86 #define VTK_IMAGE_BLEND_MODE_COMPOUND 1
87 
89 {
90 public:
91  static vtkImageBlend *New();
93  void PrintSelf(ostream& os, vtkIndent indent);
94 
99  virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input);
100 
102 
105  void SetInputData(int num, vtkDataObject *input);
106  void SetInputData(vtkDataObject *input) { this->SetInputData(0, input); };
108 
110 
113  vtkDataObject *GetInput(int num);
114  vtkDataObject *GetInput() { return this->GetInput(0); };
116 
120  int GetNumberOfInputs() { return this->GetNumberOfInputConnections(0); };
121 
123 
125  void SetOpacity(int idx, double opacity);
126  double GetOpacity(int idx);
128 
131  void SetStencilConnection(vtkAlgorithmOutput *algOutput);
132 
134 
135  void SetStencilData(vtkImageStencilData *stencil);
136  vtkImageStencilData *GetStencil();
138 
140 
141  vtkSetClampMacro(BlendMode,int,
144  vtkGetMacro(BlendMode,int);
146  {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_NORMAL);};
148  {this->SetBlendMode(VTK_IMAGE_BLEND_MODE_COMPOUND);};
149  const char *GetBlendModeAsString(void);
151 
153 
155  vtkSetMacro(CompoundThreshold,double);
156  vtkGetMacro(CompoundThreshold,double);
158 
159 protected:
160  vtkImageBlend();
161  ~vtkImageBlend();
162 
163  virtual int RequestUpdateExtent(vtkInformation *,
166 
167  void InternalComputeInputUpdateExtent(int inExt[6], int outExt[6],
168  int inWExtent[6]);
169 
170  void ThreadedRequestData (vtkInformation* request,
171  vtkInformationVector** inputVector,
172  vtkInformationVector* outputVector,
173  vtkImageData ***inData, vtkImageData **outData,
174  int ext[6], int id);
175 
176  // see vtkAlgorithm for docs.
177  virtual int FillInputPortInformation(int, vtkInformation*);
178 
179  // see vtkAlgorithm for docs.
180  virtual int RequestData(vtkInformation* request,
181  vtkInformationVector** inputVector,
182  vtkInformationVector* outputVector);
183 
184  double *Opacity;
189 
190 private:
191  vtkImageBlend(const vtkImageBlend&); // Not implemented.
192  void operator=(const vtkImageBlend&); // Not implemented.
193 };
194 
196 
198 {
199  switch (this->BlendMode)
200  {
202  return "Normal";
204  return "Compound";
205  default:
206  return "Unknown Blend Mode";
207  }
208 }
210 
211 
212 #endif
213 
214 
215 
216 
int GetNumberOfInputConnections(int port)
double CompoundThreshold
void SetInputData(vtkDataObject *input)
#define VTK_IMAGE_BLEND_MODE_COMPOUND
Definition: vtkImageBlend.h:86
const char * GetBlendModeAsString(void)
Store vtkAlgorithm input/output information.
void SetBlendModeToCompound()
vtkDataObject * GetInput()
#define VTK_IMAGE_BLEND_MODE_NORMAL
Definition: vtkImageBlend.h:85
void SetInputData(vtkDataObject *)
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Proxy object to connect input/output ports.
Generic filter that has one input..
a simple class to control print indentation
Definition: vtkIndent.h:38
efficient description of an image stencil
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
#define VTKIMAGINGCORE_EXPORT
virtual int FillInputPortInformation(int port, vtkInformation *info)
virtual void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int extent[6], int threadId)
double * Opacity
vtkDataObject * GetInput()
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetBlendModeToNormal()
blend images together using alpha or opacity
Definition: vtkImageBlend.h:88
int GetNumberOfInputs()
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
general representation of visualization data
Definition: vtkDataObject.h:64