VTK  9.3.1
vtkImageCast.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
27 #ifndef vtkImageCast_h
28 #define vtkImageCast_h
29 
30 #include "vtkImagingCoreModule.h" // For export macro
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
35 {
36 public:
37  static vtkImageCast* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
45  vtkSetMacro(OutputScalarType, int);
46  vtkGetMacro(OutputScalarType, int);
47  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
48  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
49  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
50  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
51  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
52  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
53  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
54  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
55  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
56  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
58 
60 
68  vtkSetMacro(ClampOverflow, vtkTypeBool);
69  vtkGetMacro(ClampOverflow, vtkTypeBool);
70  vtkBooleanMacro(ClampOverflow, vtkTypeBool);
72 
73 protected:
74  vtkImageCast();
75  ~vtkImageCast() override = default;
76 
80 
81  void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
82 
83 private:
84  vtkImageCast(const vtkImageCast&) = delete;
85  void operator=(const vtkImageCast&) = delete;
86 };
87 
88 VTK_ABI_NAMESPACE_END
89 #endif
Image Data type Casting Filter.
Definition: vtkImageCast.h:34
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
int OutputScalarType
Definition: vtkImageCast.h:78
virtual void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int threadId)
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:49
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:55
vtkTypeBool ClampOverflow
Definition: vtkImageCast.h:77
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_DOUBLE
Definition: vtkType.h:43
Generic filter that has one input.
#define VTK_FLOAT
Definition: vtkType.h:42
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
#define VTK_SHORT
Definition: vtkType.h:36
#define VTK_CHAR
Definition: vtkType.h:33
#define VTK_LONG
Definition: vtkType.h:40
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:52
void SetOutputScalarTypeToDouble()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:48
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:53
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:50
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:54
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:41
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:51
#define VTK_INT
Definition: vtkType.h:38
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:47
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:56