VTK  9.2.6
vtkTIFFWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTIFFWriter.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 =========================================================================*/
59 #ifndef vtkTIFFWriter_h
60 #define vtkTIFFWriter_h
61 
62 #include "vtkIOImageModule.h" // For export macro
63 #include "vtkImageWriter.h"
64 
65 class VTKIOIMAGE_EXPORT vtkTIFFWriter : public vtkImageWriter
66 {
67 public:
68  static vtkTIFFWriter* New();
69  vtkTypeMacro(vtkTIFFWriter, vtkImageWriter);
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
75  void Write() override;
76 
77  enum
78  { // Compression types
83  LZW
84  };
85 
87 
91  vtkSetClampMacro(Compression, int, NoCompression, LZW);
92  vtkGetMacro(Compression, int);
93  void SetCompressionToNoCompression() { this->SetCompression(NoCompression); }
94  void SetCompressionToPackBits() { this->SetCompression(PackBits); }
95  void SetCompressionToJPEG() { this->SetCompression(JPEG); }
96  void SetCompressionToDeflate() { this->SetCompression(Deflate); }
97  void SetCompressionToLZW() { this->SetCompression(LZW); }
99 
100 protected:
102  ~vtkTIFFWriter() override = default;
103 
104  void WriteFile(ostream* file, vtkImageData* data, int ext[6], int wExt[6]) override;
105  void WriteFileHeader(ostream*, vtkImageData*, int wExt[6]) override;
106  void WriteFileTrailer(ostream*, vtkImageData*) override;
107 
108  void* TIFFPtr;
110  int Width;
111  int Height;
112  int Pages;
113  double XResolution;
114  double YResolution;
115 
116 private:
117  vtkTIFFWriter(const vtkTIFFWriter&) = delete;
118  void operator=(const vtkTIFFWriter&) = delete;
119 
120  template <typename T>
121  void WriteVolume(T* buffer);
122 };
123 
124 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:119
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:66
~vtkTIFFWriter() override=default
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetCompressionToJPEG()
Set compression type.
Definition: vtkTIFFWriter.h:95
void WriteFileHeader(ostream *, vtkImageData *, int wExt[6]) override
void SetCompressionToNoCompression()
Set compression type.
Definition: vtkTIFFWriter.h:93
double YResolution
static vtkTIFFWriter * New()
void SetCompressionToDeflate()
Set compression type.
Definition: vtkTIFFWriter.h:96
void SetCompressionToLZW()
Set compression type.
Definition: vtkTIFFWriter.h:97
void Write() override
The main interface which triggers the writer to start.
void WriteFile(ostream *file, vtkImageData *data, int ext[6], int wExt[6]) override
double XResolution
void SetCompressionToPackBits()
Set compression type.
Definition: vtkTIFFWriter.h:94
void WriteFileTrailer(ostream *, vtkImageData *) override
@ data
Definition: vtkX3D.h:321