VTK  9.3.0
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
36 #ifndef vtkImageCast_h
37 #define vtkImageCast_h
38 
39 #include "vtkImagingCoreModule.h" // For export macro
41 
42 VTK_ABI_NAMESPACE_BEGIN
43 class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
44 {
45 public:
46  static vtkImageCast* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
54  vtkSetMacro(OutputScalarType, int);
55  vtkGetMacro(OutputScalarType, int);
56  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
57  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
58  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
59  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
60  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
61  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
62  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
63  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
64  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
65  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
67 
69 
77  vtkSetMacro(ClampOverflow, vtkTypeBool);
78  vtkGetMacro(ClampOverflow, vtkTypeBool);
79  vtkBooleanMacro(ClampOverflow, vtkTypeBool);
81 
82 protected:
84  ~vtkImageCast() override = default;
85 
89 
90  void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
91 
92 private:
93  vtkImageCast(const vtkImageCast&) = delete;
94  void operator=(const vtkImageCast&) = delete;
95 };
96 
97 VTK_ABI_NAMESPACE_END
98 #endif
Image Data type Casting Filter.
Definition: vtkImageCast.h:44
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int ext[6], int id) override
vtkTypeBool ClampOverflow
Definition: vtkImageCast.h:86
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:60
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:56
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:61
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
void SetOutputScalarTypeToDouble()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:57
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:62
static vtkImageCast * New()
int OutputScalarType
Definition: vtkImageCast.h:87
~vtkImageCast() override=default
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:65
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:64
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:58
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:63
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
a simple class to control print indentation
Definition: vtkIndent.h:38
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_SHORT
Definition: vtkType.h:36
#define VTK_UNSIGNED_INT
Definition: vtkType.h:39
#define VTK_DOUBLE
Definition: vtkType.h:43
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:35
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:37
#define VTK_INT
Definition: vtkType.h:38
#define VTK_FLOAT
Definition: vtkType.h:42
#define VTK_CHAR
Definition: vtkType.h:33
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:41
#define VTK_LONG
Definition: vtkType.h:40