VTK
vtkThreadedImageWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkThreadedImageWriter.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 =========================================================================*/
26 #ifndef vtkThreadedImageWriter_h
27 #define vtkThreadedImageWriter_h
28 
29 #include "vtkIOAsynchronousModule.h" // For export macro
30 #include "vtkObject.h"
31 
32 class vtkImageData;
33 
34 class VTKIOASYNCHRONOUS_EXPORT vtkThreadedImageWriter : public vtkObject
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
49  void Initialize();
50 
55  void EncodeAndWrite(vtkImageData* image, const char* fileName);
56 
63  void PushImageToQueue(vtkImageData*& data, const char* fileName);
64 
69  void SetMaxThreads(vtkTypeUInt32);
70  vtkGetMacro(MaxThreads, vtkTypeUInt32);
71 
75  void Finalize();
76 
77 protected:
80 
81 private:
83  void operator=(const vtkThreadedImageWriter&) = delete;
84 
85  class vtkInternals;
86  vtkInternals* Internals;
87  vtkTypeUInt32 MaxThreads;
88 };
89 
90 #endif
vtkThreadedImageWriter::Finalize
void Finalize()
This method will wait for any running thread to terminate.
vtkThreadedImageWriter::Initialize
void Initialize()
Need to be called at least once before using the class.
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkX3D::image
@ image
Definition: vtkX3D.h:374
vtkThreadedImageWriter::~vtkThreadedImageWriter
~vtkThreadedImageWriter() override
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkThreadedImageWriter
class used to compress/write images using threads to prevent locking while encoding data.
Definition: vtkThreadedImageWriter.h:35
vtkThreadedImageWriter::PushImageToQueue
void PushImageToQueue(vtkImageData *&data, const char *fileName)
Push an image into the threaded writer.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkThreadedImageWriter::SetMaxThreads
void SetMaxThreads(vtkTypeUInt32)
Define the number of worker thread to use.
vtkThreadedImageWriter::vtkThreadedImageWriter
vtkThreadedImageWriter()
vtkObject.h
vtkThreadedImageWriter::EncodeAndWrite
void EncodeAndWrite(vtkImageData *image, const char *fileName)
Use vtkErrorMacro to check that image is valid then call PushImageToQueue() internally if image is pr...
vtkThreadedImageWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkThreadedImageWriter::New
static vtkThreadedImageWriter * New()