VTK  9.1.0
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 =========================================================================*/
66 #ifndef vtkTIFFWriter_h
67 #define vtkTIFFWriter_h
68 
69 #include "vtkIOImageModule.h" // For export macro
70 #include "vtkImageWriter.h"
71 
72 class VTKIOIMAGE_EXPORT vtkTIFFWriter : public vtkImageWriter
73 {
74 public:
75  static vtkTIFFWriter* New();
76  vtkTypeMacro(vtkTIFFWriter, vtkImageWriter);
77  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
82  void Write() override;
83 
84  enum
85  { // Compression types
90  LZW
91  };
92 
94 
98  vtkSetClampMacro(Compression, int, NoCompression, LZW);
99  vtkGetMacro(Compression, int);
100  void SetCompressionToNoCompression() { this->SetCompression(NoCompression); }
101  void SetCompressionToPackBits() { this->SetCompression(PackBits); }
102  void SetCompressionToJPEG() { this->SetCompression(JPEG); }
103  void SetCompressionToDeflate() { this->SetCompression(Deflate); }
104  void SetCompressionToLZW() { this->SetCompression(LZW); }
106 
107 protected:
109  ~vtkTIFFWriter() override = default;
110 
111  void WriteFile(ostream* file, vtkImageData* data, int ext[6], int wExt[6]) override;
112  void WriteFileHeader(ostream*, vtkImageData*, int wExt[6]) override;
113  void WriteFileTrailer(ostream*, vtkImageData*) override;
114 
115  void* TIFFPtr;
117  int Width;
118  int Height;
119  int Pages;
120  double XResolution;
121  double YResolution;
122 
123 private:
124  vtkTIFFWriter(const vtkTIFFWriter&) = delete;
125  void operator=(const vtkTIFFWriter&) = delete;
126 
127  template <typename T>
128  void WriteVolume(T* buffer);
129 };
130 
131 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:113
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:73
~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.
void WriteFileHeader(ostream *, vtkImageData *, int wExt[6]) override
void SetCompressionToNoCompression()
Set compression type.
double YResolution
static vtkTIFFWriter * New()
void SetCompressionToDeflate()
Set compression type.
void SetCompressionToLZW()
Set compression type.
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.
void WriteFileTrailer(ostream *, vtkImageData *) override
@ data
Definition: vtkX3D.h:321