Loading [MathJax]/extensions/tex2jax.js
VTK  9.4.20250419
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
147#ifndef vtkImageBlend_h
148#define vtkImageBlend_h
149
150#include "vtkImagingCoreModule.h" // For export macro
152
153VTK_ABI_NAMESPACE_BEGIN
155
156#define VTK_IMAGE_BLEND_MODE_NORMAL 0
157#define VTK_IMAGE_BLEND_MODE_COMPOUND 1
158
159class VTKIMAGINGCORE_EXPORT vtkImageBlend : public vtkThreadedImageAlgorithm
160{
161public:
164 void PrintSelf(ostream& os, vtkIndent indent) override;
165
172 virtual void ReplaceNthInputConnection(int idx, vtkAlgorithmOutput* input);
173
175
180 void SetInputData(int num, vtkDataObject* input);
181 void SetInputData(vtkDataObject* input) { this->SetInputData(0, input); }
183
185
191 vtkDataObject* GetInput() { return this->GetInput(0); }
193
200
202
206 void SetOpacity(int idx, double opacity);
207 double GetOpacity(int idx);
209
215
217
223
225
229 vtkGetMacro(BlendMode, int);
230 void SetBlendModeToNormal() { this->SetBlendMode(VTK_IMAGE_BLEND_MODE_NORMAL); }
232 const char* GetBlendModeAsString();
234
236
249 vtkSetMacro(BlendAlpha, vtkTypeBool);
250 vtkGetMacro(BlendAlpha, vtkTypeBool);
251 vtkBooleanMacro(BlendAlpha, vtkTypeBool);
253
255
260 vtkSetMacro(CompoundThreshold, double);
261 vtkGetMacro(CompoundThreshold, double);
263
265
271 vtkSetMacro(CompoundAlpha, vtkTypeBool);
272 vtkGetMacro(CompoundAlpha, vtkTypeBool);
273 vtkBooleanMacro(CompoundAlpha, vtkTypeBool);
275
276protected:
278 ~vtkImageBlend() override;
279
281
282 void InternalComputeInputUpdateExtent(int inExt[6], int outExt[6], int inWExtent[6]);
283
285 vtkInformationVector* outputVector, vtkImageData*** inData, vtkImageData** outData, int ext[6],
286 int id) override;
287
288 // see vtkAlgorithm for docs.
290
291 // see vtkAlgorithm for docs.
293 vtkInformationVector* outputVector) override;
294
295 double* Opacity;
302
303private:
304 vtkImageBlend(const vtkImageBlend&) = delete;
305 void operator=(const vtkImageBlend&) = delete;
306};
307
312{
313 switch (this->BlendMode)
314 {
316 return "Normal";
318 return "Compound";
319 default:
320 return "Unknown Blend Mode";
321 }
322}
323
324VTK_ABI_NAMESPACE_END
325#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
vtkTypeBool BlendAlpha
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