VTK  9.2.6
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=========================================================================*/
88#ifndef vtkImageBlend_h
89#define vtkImageBlend_h
90
91#include "vtkImagingCoreModule.h" // For export macro
93
95
96#define VTK_IMAGE_BLEND_MODE_NORMAL 0
97#define VTK_IMAGE_BLEND_MODE_COMPOUND 1
98
99class VTKIMAGINGCORE_EXPORT vtkImageBlend : public vtkThreadedImageAlgorithm
100{
101public:
104 void PrintSelf(ostream& os, vtkIndent indent) override;
105
112 virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input);
113
115
120 void SetInputData(int num, vtkDataObject* input);
121 void SetInputData(vtkDataObject* input) { this->SetInputData(0, input); }
123
125
131 vtkDataObject* GetInput() { return this->GetInput(0); }
133
140
142
146 void SetOpacity(int idx, double opacity);
147 double GetOpacity(int idx);
149
155
157
163
165
169 vtkGetMacro(BlendMode, int);
170 void SetBlendModeToNormal() { this->SetBlendMode(VTK_IMAGE_BLEND_MODE_NORMAL); }
172 const char* GetBlendModeAsString(void);
174
176
180 vtkSetMacro(CompoundThreshold, double);
181 vtkGetMacro(CompoundThreshold, double);
183
185
190 vtkSetMacro(CompoundAlpha, vtkTypeBool);
191 vtkGetMacro(CompoundAlpha, vtkTypeBool);
192 vtkBooleanMacro(CompoundAlpha, vtkTypeBool);
194
195protected:
197 ~vtkImageBlend() override;
198
200
201 void InternalComputeInputUpdateExtent(int inExt[6], int outExt[6], int inWExtent[6]);
202
204 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
205 int id) override;
206
207 // see vtkAlgorithm for docs.
209
210 // see vtkAlgorithm for docs.
212 vtkInformationVector* outputVector) override;
213
214 double* Opacity;
220
221private:
222 vtkImageBlend(const vtkImageBlend&) = delete;
223 void operator=(const vtkImageBlend&) = delete;
224};
225
230{
231 switch (this->BlendMode)
232 {
234 return "Normal";
236 return "Compound";
237 default:
238 return "Unknown Blend Mode";
239 }
240}
241
242#endif
Proxy object to connect input/output ports.
int GetNumberOfInputConnections(int port)
Get the number of inputs currently connected to a port.
general representation of visualization data
blend images together using alpha or opacity
vtkDataObject * GetInput()
Get one input to this filter.
void SetStencilData(vtkImageStencilData *stencil)
Set a stencil to apply when blending the data.
void SetBlendModeToNormal()
Set the blend mode.
vtkTypeBool CompoundAlpha
void SetOpacity(int idx, double opacity)
Set the opacity of an input image: the alpha values of the image are multiplied by the opacity.
virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput *input)
Replace one of the input connections with a new input.
void SetBlendModeToCompound()
Set the blend mode.
void SetInputData(int num, vtkDataObject *input)
Assign a data object as input.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to translate the update extent requests from each output port ...
const char * GetBlendModeAsString(void)
Get the blending mode as a descriptive string.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
void InternalComputeInputUpdateExtent(int inExt[6], int outExt[6], int inWExtent[6])
void SetInputData(vtkDataObject *input)
Assign a data object as input.
int FillInputPortInformation(int, vtkInformation *) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ThreadedRequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector, vtkImageData ***inData, vtkImageData **outData, int ext[6], int id) override
If the subclass does not define an Execute method, then the task will be broken up,...
vtkDataObject * GetInput(int num)
Get one input to this filter.
~vtkImageBlend() override
double CompoundThreshold
vtkImageStencilData * GetStencil()
Set a stencil to apply when blending the data.
int GetNumberOfInputs()
Get the number of inputs to this filter.
double GetOpacity(int idx)
Set the opacity of an input image: the alpha values of the image are multiplied by the opacity.
void SetStencilConnection(vtkAlgorithmOutput *algOutput)
Set a stencil to apply when blending the data.
static vtkImageBlend * New()
topologically and geometrically regular array of data
efficient description of an image stencil
a simple class to control print indentation
Definition vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_IMAGE_BLEND_MODE_NORMAL
#define VTK_IMAGE_BLEND_MODE_COMPOUND