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 
100 
102 
106  void SetInputData(vtkDataObject *input) { this->SetInputData(0, input); };
108 
110 
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 
132 
134 
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:
162 
166 
167  void InternalComputeInputUpdateExtent(int inExt[6], int outExt[6],
168  int inWExtent[6]);
169 
171  vtkInformationVector** inputVector,
172  vtkInformationVector* outputVector,
173  vtkImageData ***inData, vtkImageData **outData,
174  int ext[6], int id);
175 
176  // see vtkAlgorithm for docs.
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 
vtkImageBlend::DataWasPassed
int DataWasPassed
Definition: vtkImageBlend.h:188
vtkImageBlend::BlendMode
int BlendMode
Definition: vtkImageBlend.h:186
vtkImageBlend::SetOpacity
void SetOpacity(int idx, double opacity)
vtkImageBlend::ReplaceNthInputConnection
virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput *input)
vtkImageBlend::SetInputData
void SetInputData(vtkDataObject *input)
Definition: vtkImageBlend.h:106
vtkImageBlend::SetBlendModeToCompound
void SetBlendModeToCompound()
Definition: vtkImageBlend.h:147
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkImageBlend::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkImageBlend::GetBlendModeAsString
const char * GetBlendModeAsString(void)
Definition: vtkImageBlend.h:197
VTK_IMAGE_BLEND_MODE_NORMAL
#define VTK_IMAGE_BLEND_MODE_NORMAL
Definition: vtkImageBlend.h:85
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
VTK_IMAGE_BLEND_MODE_COMPOUND
#define VTK_IMAGE_BLEND_MODE_COMPOUND
Definition: vtkImageBlend.h:86
vtkThreadedImageAlgorithm
Generic filter that has one input..
Definition: vtkThreadedImageAlgorithm.h:37
vtkImageBlend::SetStencilData
void SetStencilData(vtkImageStencilData *stencil)
vtkImageBlend::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkImageBlend
blend images together using alpha or opacity
Definition: vtkImageBlend.h:89
vtkImageBlend::vtkImageBlend
vtkImageBlend()
vtkImageBlend::SetStencilConnection
void SetStencilConnection(vtkAlgorithmOutput *algOutput)
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkImageBlend::OpacityArrayLength
int OpacityArrayLength
Definition: vtkImageBlend.h:185
vtkThreadedImageAlgorithm.h
vtkImageBlend::SetBlendModeToNormal
void SetBlendModeToNormal()
Definition: vtkImageBlend.h:145
vtkImageBlend::Opacity
double * Opacity
Definition: vtkImageBlend.h:184
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkImageBlend::GetInput
vtkDataObject * GetInput(int num)
vtkImageBlend::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageBlend::New
static vtkImageBlend * New()
vtkgl::stencil
GLint GLfloat GLint stencil
Definition: vtkgl.h:12368
vtkgl::num
GLuint GLuint num
Definition: vtkgl.h:16907
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkImageBlend::SetInputData
void SetInputData(int num, vtkDataObject *input)
vtkImageBlend::FillInputPortInformation
virtual int FillInputPortInformation(int, vtkInformation *)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkImageBlend::GetStencil
vtkImageStencilData * GetStencil()
vtkImageBlend::GetInput
vtkDataObject * GetInput()
Definition: vtkImageBlend.h:114
vtkImageBlend::GetOpacity
double GetOpacity(int idx)
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkImageStencilData
efficient description of an image stencil
Definition: vtkImageStencilData.h:37
vtkImageBlend::GetNumberOfInputs
int GetNumberOfInputs()
Definition: vtkImageBlend.h:120
vtkImagingCoreModule.h
vtkImageBlend::~vtkImageBlend
~vtkImageBlend()
VTKIMAGINGCORE_EXPORT
#define VTKIMAGINGCORE_EXPORT
Definition: vtkImagingCoreModule.h:15
vtkAlgorithm::GetNumberOfInputConnections
int GetNumberOfInputConnections(int port)
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkImageBlend::CompoundThreshold
double CompoundThreshold
Definition: vtkImageBlend.h:187
vtkImageBlend::InternalComputeInputUpdateExtent
void InternalComputeInputUpdateExtent(int inExt[6], int outExt[6], int inWExtent[6])
vtkImageBlend::ThreadedRequestData
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int ext[6], int id)