VTK  9.1.0
vtkImageCast.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImageCast.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
142#ifndef vtkImageCast_h
143#define vtkImageCast_h
144
145#include "vtkImagingCoreModule.h" // For export macro
147
148class VTKIMAGINGCORE_EXPORT vtkImageCast : public vtkThreadedImageAlgorithm
149{
150public:
151 static vtkImageCast* New();
153 void PrintSelf(ostream& os, vtkIndent indent) override;
154
156
159 vtkSetMacro(OutputScalarType, int);
160 vtkGetMacro(OutputScalarType, int);
161 void SetOutputScalarTypeToFloat() { this->SetOutputScalarType(VTK_FLOAT); }
162 void SetOutputScalarTypeToDouble() { this->SetOutputScalarType(VTK_DOUBLE); }
163 void SetOutputScalarTypeToInt() { this->SetOutputScalarType(VTK_INT); }
164 void SetOutputScalarTypeToUnsignedInt() { this->SetOutputScalarType(VTK_UNSIGNED_INT); }
165 void SetOutputScalarTypeToLong() { this->SetOutputScalarType(VTK_LONG); }
166 void SetOutputScalarTypeToUnsignedLong() { this->SetOutputScalarType(VTK_UNSIGNED_LONG); }
167 void SetOutputScalarTypeToShort() { this->SetOutputScalarType(VTK_SHORT); }
168 void SetOutputScalarTypeToUnsignedShort() { this->SetOutputScalarType(VTK_UNSIGNED_SHORT); }
169 void SetOutputScalarTypeToUnsignedChar() { this->SetOutputScalarType(VTK_UNSIGNED_CHAR); }
170 void SetOutputScalarTypeToChar() { this->SetOutputScalarType(VTK_CHAR); }
172
174
182 vtkSetMacro(ClampOverflow, vtkTypeBool);
183 vtkGetMacro(ClampOverflow, vtkTypeBool);
184 vtkBooleanMacro(ClampOverflow, vtkTypeBool);
186
187protected:
189 ~vtkImageCast() override = default;
190
194
195 void ThreadedExecute(vtkImageData* inData, vtkImageData* outData, int ext[6], int id) override;
196
197private:
198 vtkImageCast(const vtkImageCast&) = delete;
199 void operator=(const vtkImageCast&) = delete;
200};
201
202#endif
Image Data type Casting Filter.
Definition: vtkImageCast.h:149
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int ext[6], int id) override
vtkTypeBool ClampOverflow
Definition: vtkImageCast.h:191
void SetOutputScalarTypeToLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:165
void SetOutputScalarTypeToFloat()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:161
void SetOutputScalarTypeToUnsignedLong()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:166
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:162
void SetOutputScalarTypeToShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:167
static vtkImageCast * New()
int OutputScalarType
Definition: vtkImageCast.h:192
~vtkImageCast() override=default
void SetOutputScalarTypeToChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:170
void SetOutputScalarTypeToUnsignedChar()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:169
void SetOutputScalarTypeToInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:163
void SetOutputScalarTypeToUnsignedShort()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:168
void SetOutputScalarTypeToUnsignedInt()
Set the desired output scalar type to cast to.
Definition: vtkImageCast.h:164
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:157
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Generic filter that has one input.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SHORT
Definition: vtkType.h:48
#define VTK_UNSIGNED_INT
Definition: vtkType.h:51
#define VTK_DOUBLE
Definition: vtkType.h:55
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:47
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:49
#define VTK_INT
Definition: vtkType.h:50
#define VTK_FLOAT
Definition: vtkType.h:54
#define VTK_CHAR
Definition: vtkType.h:45
#define VTK_UNSIGNED_LONG
Definition: vtkType.h:53
#define VTK_LONG
Definition: vtkType.h:52