VTK  9.3.20240418
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
136 #ifndef vtkImageCast_h
137 #define vtkImageCast_h
138 
139 #include "vtkImagingCoreModule.h" // For export macro
141 
142 VTK_ABI_NAMESPACE_BEGIN
143 class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
144 {
145 public:
146  static vtkImageCast* New();
148  void PrintSelf(ostream& os, vtkIndent indent) override;
149 
151 
154  vtkSetMacro(OutputScalarType, int);
155  vtkGetMacro(OutputScalarType, int);
156  void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
157  void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
158  void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
159  void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
160  void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
161  void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
162  void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
163  void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
164  void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
165  void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
167 
169 
177  vtkSetMacro(ClampOverflow, vtkTypeBool);
178  vtkGetMacro(ClampOverflow, vtkTypeBool);
179  vtkBooleanMacro(ClampOverflow, vtkTypeBool);
181 
182 protected:
184  ~vtkImageCast() override = default;
185 
189 
190  void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
191 
192 private:
193  vtkImageCast(const vtkImageCast&) = delete;
194  void operator=(const vtkImageCast&) = delete;
195 };
196 
197 VTK_ABI_NAMESPACE_END
198 #endif
Image Data type Casting Filter.
Definition: vtkImageCast.h:144
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int ext[6], int id) override
vtkTypeBool ClampOverflow
Definition: vtkImageCast.h:186
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:160
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:156
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:161
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:157
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:162
static vtkImageCast * New()
int OutputScalarType
Definition: vtkImageCast.h:187
~vtkImageCast() override=default
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:165
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:164
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:158
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:163
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:159
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:156
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_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