VTK  9.5.2
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
33VTK_ABI_NAMESPACE_BEGIN
34class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
35{
36public:
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
73protected:
75 ~vtkImageCast() override = default;
76
80
81 void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
82
83private:
84 vtkImageCast(const vtkImageCast&) = delete;
85 void operator=(const vtkImageCast&) = delete;
86};
87
88VTK_ABI_NAMESPACE_END
89#endif
Image Data type Casting Filter.
Definition: vtkImageCast.h:35
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int ext[6], int id) override
vtkTypeBool ClampOverflow
Definition: vtkImageCast.h:77
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:51
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:47
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:52
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:48
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:53
static vtkImageCast * New()
int OutputScalarType
Definition: vtkImageCast.h:78
~vtkImageCast() override=default
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:56
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:55
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:49
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:54
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:50
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:47
a simple class to control print indentation
Definition: vtkIndent.h:29
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:37
#define VTK_UNSIGNED_INT
Definition: vtkType.h:40
#define VTK_DOUBLE
Definition: vtkType.h:44
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:36
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:38
#define VTK_INT
Definition: vtkType.h:39
#define VTK_FLOAT
Definition: vtkType.h:43
#define VTK_CHAR
Definition: vtkType.h:34
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:42
#define VTK_LONG
Definition: vtkType.h:41