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 =========================================================================*/
39 #ifndef vtkTIFFWriter_h
40 #define vtkTIFFWriter_h
41 
42 #include "vtkIOImageModule.h" // For export macro
43 #include "vtkImageWriter.h"
44 
45 class VTKIOIMAGE_EXPORT vtkTIFFWriter : public vtkImageWriter
46 {
47 public:
48  static vtkTIFFWriter* New();
49  vtkTypeMacro(vtkTIFFWriter, vtkImageWriter);
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
55  void Write() override;
56 
57  enum
58  { // Compression types
63  LZW
64  };
65 
67 
71  vtkSetClampMacro(Compression, int, NoCompression, LZW);
72  vtkGetMacro(Compression, int);
73  void SetCompressionToNoCompression() { this->SetCompression(NoCompression); }
74  void SetCompressionToPackBits() { this->SetCompression(PackBits); }
75  void SetCompressionToJPEG() { this->SetCompression(JPEG); }
76  void SetCompressionToDeflate() { this->SetCompression(Deflate); }
77  void SetCompressionToLZW() { this->SetCompression(LZW); }
79 
80 protected:
82  ~vtkTIFFWriter() override = default;
83 
84  void WriteFile(ostream* file, vtkImageData* data, int ext[6], int wExt[6]) override;
85  void WriteFileHeader(ostream*, vtkImageData*, int wExt[6]) override;
86  void WriteFileTrailer(ostream*, vtkImageData*) override;
87 
88  void* TIFFPtr;
90  int Width;
91  int Height;
92  int Pages;
93  double XResolution;
94  double YResolution;
95 
96 private:
97  vtkTIFFWriter(const vtkTIFFWriter&) = delete;
98  void operator=(const vtkTIFFWriter&) = delete;
99 
100  template <typename T>
101  void WriteVolume(T* buffer);
102 };
103 
104 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:63
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:49
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:46
~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:75
void WriteFileHeader(ostream *, vtkImageData *, int wExt[6]) override
void SetCompressionToNoCompression()
Set compression type.
Definition: vtkTIFFWriter.h:73
double YResolution
Definition: vtkTIFFWriter.h:94
static vtkTIFFWriter * New()
void SetCompressionToDeflate()
Set compression type.
Definition: vtkTIFFWriter.h:76
void SetCompressionToLZW()
Set compression type.
Definition: vtkTIFFWriter.h:77
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
Definition: vtkTIFFWriter.h:93
void SetCompressionToPackBits()
Set compression type.
Definition: vtkTIFFWriter.h:74
void WriteFileTrailer(ostream *, vtkImageData *) override
@ data
Definition: vtkX3D.h:321