VTK  9.3.20240424
vtkImageBlend.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
146#ifndef vtkImageBlend_h
147#define vtkImageBlend_h
148
149#include "vtkImagingCoreModule.h" // For export macro
151
152VTK_ABI_NAMESPACE_BEGIN
154
155#define VTK_IMAGE_BLEND_MODE_NORMAL 0
156#define VTK_IMAGE_BLEND_MODE_COMPOUND 1
157
158class VTKIMAGINGCORE_EXPORT vtkImageBlend : public vtkThreadedImageAlgorithm
159{
160public:
163 void PrintSelf(ostream& os, vtkIndent indent) override;
164
171 virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input);
172
174
179 void SetInputData(int num, vtkDataObject* input);
180 void SetInputData(vtkDataObject* input) { this->SetInputData(0, input); }
182
184
190 vtkDataObject* GetInput() { return this->GetInput(0); }
192
199
201
205 void SetOpacity(int idx, double opacity);
206 double GetOpacity(int idx);
208
214
216
222
224
228 vtkGetMacro(BlendMode, int);
229 void SetBlendModeToNormal() { this->SetBlendMode(VTK_IMAGE_BLEND_MODE_NORMAL); }
231 const char* GetBlendModeAsString();
233
235
239 vtkSetMacro(CompoundThreshold, double);
240 vtkGetMacro(CompoundThreshold, double);
242
244
249 vtkSetMacro(CompoundAlpha, vtkTypeBool);
250 vtkGetMacro(CompoundAlpha, vtkTypeBool);
251 vtkBooleanMacro(CompoundAlpha, vtkTypeBool);
253
254protected:
256 ~vtkImageBlend() override;
257
259
260 void InternalComputeInputUpdateExtent(int inExt[6], int outExt[6], int inWExtent[6]);
261
263 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
264 int id) override;
265
266 // see vtkAlgorithm for docs.
268
269 // see vtkAlgorithm for docs.
271 vtkInformationVector* outputVector) override;
272
273 double* Opacity;
279
280private:
281 vtkImageBlend(const vtkImageBlend&) = delete;
282 void operator=(const vtkImageBlend&) = delete;
283};
284
289{
290 switch (this->BlendMode)
291 {
293 return "Normal";
295 return "Compound";
296 default:
297 return "Unknown Blend Mode";
298 }
299}
300
301VTK_ABI_NAMESPACE_END
302#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 ...
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.
const char * GetBlendModeAsString()
Get the blending mode as a descriptive string.
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_IMAGE_BLEND_MODE_NORMAL
#define VTK_IMAGE_BLEND_MODE_COMPOUND