VTK  9.3.20240226
vtkImageMaskBits.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
15 #ifndef vtkImageMaskBits_h
16 #define vtkImageMaskBits_h
17 
18 #include "vtkImageLogic.h" //For VTK_AND, VTK_OR ...
19 #include "vtkImagingMathModule.h" // For export macro
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class VTKIMAGINGMATH_EXPORT vtkImageMaskBits : public vtkThreadedImageAlgorithm
24 {
25 public:
26  static vtkImageMaskBits* New();
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
31 
34  vtkSetVector4Macro(Masks, unsigned int);
35  void SetMask(unsigned int mask) { this->SetMasks(mask, mask, mask, mask); }
36  void SetMasks(unsigned int mask1, unsigned int mask2)
37  {
38  this->SetMasks(mask1, mask2, 0xffffffff, 0xffffffff);
39  }
40  void SetMasks(unsigned int mask1, unsigned int mask2, unsigned int mask3)
41  {
42  this->SetMasks(mask1, mask2, mask3, 0xffffffff);
43  }
44  vtkGetVector4Macro(Masks, unsigned int);
46 
48 
51  vtkSetMacro(Operation, int);
52  vtkGetMacro(Operation, int);
53  void SetOperationToAnd() { this->SetOperation(VTK_AND); }
54  void SetOperationToOr() { this->SetOperation(VTK_OR); }
55  void SetOperationToXor() { this->SetOperation(VTK_XOR); }
56  void SetOperationToNand() { this->SetOperation(VTK_NAND); }
57  void SetOperationToNor() { this->SetOperation(VTK_NOR); }
59 
60 protected:
62  ~vtkImageMaskBits() override = default;
63 
64  void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
65 
66  unsigned int Masks[4];
67  int Operation;
68 
69 private:
70  vtkImageMaskBits(const vtkImageMaskBits&) = delete;
71  void operator=(const vtkImageMaskBits&) = delete;
72 };
73 
74 VTK_ABI_NAMESPACE_END
75 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
applies a bit-mask pattern to each component.
void SetOperationToAnd()
Set/Get the boolean operator.
void SetMasks(unsigned int mask1, unsigned int mask2)
Set/Get the bit-masks.
~vtkImageMaskBits() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkImageMaskBits * New()
void SetMask(unsigned int mask)
Set/Get the bit-masks.
void SetMasks(unsigned int mask1, unsigned int mask2, unsigned int mask3)
Set/Get the bit-masks.
void SetOperationToNand()
Set/Get the boolean operator.
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int ext[6], int id) override
void SetOperationToOr()
Set/Get the boolean operator.
void SetOperationToNor()
Set/Get the boolean operator.
void SetOperationToXor()
Set/Get the boolean operator.
a simple class to control print indentation
Definition: vtkIndent.h:108
Generic filter that has one input.
#define VTK_NAND
Definition: vtkImageLogic.h:22
#define VTK_AND
Definition: vtkImageLogic.h:19
#define VTK_XOR
Definition: vtkImageLogic.h:21
#define VTK_NOR
Definition: vtkImageLogic.h:23
#define VTK_OR
Definition: vtkImageLogic.h:20