VTK  9.0.3
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 =========================================================================*/
27 #ifndef vtkTIFFWriter_h
28 #define vtkTIFFWriter_h
29 
30 #include "vtkIOImageModule.h" // For export macro
31 #include "vtkImageWriter.h"
32 
33 class VTKIOIMAGE_EXPORT vtkTIFFWriter : public vtkImageWriter
34 {
35 public:
36  static vtkTIFFWriter* New();
37  vtkTypeMacro(vtkTIFFWriter, vtkImageWriter);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  void Write() override;
44 
45  enum
46  { // Compression types
51  LZW
52  };
53 
55 
59  vtkSetClampMacro(Compression, int, NoCompression, LZW);
60  vtkGetMacro(Compression, int);
61  void SetCompressionToNoCompression() { this->SetCompression(NoCompression); }
62  void SetCompressionToPackBits() { this->SetCompression(PackBits); }
63  void SetCompressionToJPEG() { this->SetCompression(JPEG); }
64  void SetCompressionToDeflate() { this->SetCompression(Deflate); }
65  void SetCompressionToLZW() { this->SetCompression(LZW); }
67 
68 protected:
70  ~vtkTIFFWriter() override {}
71 
72  void WriteFile(ostream* file, vtkImageData* data, int ext[6], int wExt[6]) override;
73  void WriteFileHeader(ostream*, vtkImageData*, int wExt[6]) override;
74  void WriteFileTrailer(ostream*, vtkImageData*) override;
75 
76  void* TIFFPtr;
78  int Width;
79  int Height;
80  int Pages;
81  double XResolution;
82  double YResolution;
83 
84 private:
85  vtkTIFFWriter(const vtkTIFFWriter&) = delete;
86  void operator=(const vtkTIFFWriter&) = delete;
87 
88  template <typename T>
89  void WriteVolume(T* buffer);
90 };
91 
92 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:34
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:34
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetCompressionToJPEG()
Definition: vtkTIFFWriter.h:63
void WriteFileHeader(ostream *, vtkImageData *, int wExt[6]) override
void SetCompressionToNoCompression()
Definition: vtkTIFFWriter.h:61
double YResolution
Definition: vtkTIFFWriter.h:82
static vtkTIFFWriter * New()
void SetCompressionToDeflate()
Definition: vtkTIFFWriter.h:64
void SetCompressionToLZW()
Definition: vtkTIFFWriter.h:65
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:81
void SetCompressionToPackBits()
Definition: vtkTIFFWriter.h:62
~vtkTIFFWriter() override
Definition: vtkTIFFWriter.h:70
void WriteFileTrailer(ostream *, vtkImageData *) override
@ data
Definition: vtkX3D.h:321