VTK  9.3.20240419
vtkThreadedImageWriter.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
17 #ifndef vtkThreadedImageWriter_h
18 #define vtkThreadedImageWriter_h
19 
20 #include "vtkIOAsynchronousModule.h" // For export macro
21 #include "vtkObject.h"
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkImageData;
25 
26 class VTKIOASYNCHRONOUS_EXPORT vtkThreadedImageWriter : public vtkObject
27 {
28 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
41  void Initialize();
42 
49  void EncodeAndWrite(vtkImageData* image, VTK_FILEPATH const char* fileName);
50 
55  void SetMaxThreads(vtkTypeUInt32);
56  vtkGetMacro(MaxThreads, vtkTypeUInt32);
57 
61  void Finalize();
62 
63 protected:
66 
67 private:
69  void operator=(const vtkThreadedImageWriter&) = delete;
70 
71  class vtkInternals;
72  vtkInternals* Internals;
73  vtkTypeUInt32 MaxThreads;
74 };
75 
76 VTK_ABI_NAMESPACE_END
77 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:156
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
class used to compress/write images using threads to prevent locking while encoding data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void EncodeAndWrite(vtkImageData *image, VTK_FILEPATH const char *fileName)
Push an image into the threaded writer.
void Finalize()
This method will wait for any running thread to terminate.
void SetMaxThreads(vtkTypeUInt32)
Define the number of worker thread to use.
void Initialize()
Need to be called at least once before using the class.
static vtkThreadedImageWriter * New()
~vtkThreadedImageWriter() override
@ image
Definition: vtkX3D.h:374
#define VTK_FILEPATH