VTK  9.4.20250206
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
142VTK_ABI_NAMESPACE_BEGIN
143class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
144{
145public:
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
182protected:
184 ~vtkImageCast() override = default;
185
189
190 void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
191
192private:
193 vtkImageCast(const vtkImageCast&) = delete;
194 void operator=(const vtkImageCast&) = delete;
195};
196
197VTK_ABI_NAMESPACE_END
198#endif
Image Data type Casting Filter.
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int ext[6], int id) override
vtkTypeBool ClampOverflow
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
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.
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
static vtkImageCast * New()
~vtkImageCast() override=default
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
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
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