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 =========================================================================*/
30 #ifndef vtkTIFFWriter_h
31 #define vtkTIFFWriter_h
32 
33 #include "vtkIOImageModule.h" // For export macro
34 #include "vtkImageWriter.h"
35 
36 class VTKIOIMAGE_EXPORT vtkTIFFWriter : public vtkImageWriter
37 {
38 public:
39  static vtkTIFFWriter* New();
40  vtkTypeMacro(vtkTIFFWriter, vtkImageWriter);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  void Write() override;
47 
48  enum
49  { // Compression types
54  LZW
55  };
56 
58 
62  vtkSetClampMacro(Compression, int, NoCompression, LZW);
63  vtkGetMacro(Compression, int);
64  void SetCompressionToNoCompression() { this->SetCompression(NoCompression); }
65  void SetCompressionToPackBits() { this->SetCompression(PackBits); }
66  void SetCompressionToJPEG() { this->SetCompression(JPEG); }
67  void SetCompressionToDeflate() { this->SetCompression(Deflate); }
68  void SetCompressionToLZW() { this->SetCompression(LZW); }
70 
71 protected:
72  vtkTIFFWriter();
73  ~vtkTIFFWriter() override = default;
74 
75  void WriteFile(ostream* file, vtkImageData* data, int ext[6], int wExt[6]) override;
76  void WriteFileHeader(ostream*, vtkImageData*, int wExt[6]) override;
77  void WriteFileTrailer(ostream*, vtkImageData*) override;
78 
79  void* TIFFPtr;
81  int Width;
82  int Height;
83  int Pages;
84  double XResolution;
85  double YResolution;
86 
87 private:
88  vtkTIFFWriter(const vtkTIFFWriter&) = delete;
89  void operator=(const vtkTIFFWriter&) = delete;
90 
91  template <typename T>
92  void WriteVolume(T* buffer);
93 };
94 
95 #endif
void SetCompressionToDeflate()
Set compression type.
Definition: vtkTIFFWriter.h:67
virtual void WriteFileHeader(ostream *, vtkImageData *, int[6])
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:36
virtual void WriteFile(ostream *file, vtkImageData *data, int extent[6], int wExtent[6])
void SetCompressionToLZW()
Set compression type.
Definition: vtkTIFFWriter.h:68
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetCompressionToNoCompression()
Set compression type.
Definition: vtkTIFFWriter.h:64
void SetCompressionToJPEG()
Set compression type.
Definition: vtkTIFFWriter.h:66
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
virtual void Write()
The main interface which triggers the writer to start.
void SetCompressionToPackBits()
Set compression type.
Definition: vtkTIFFWriter.h:65
double XResolution
Definition: vtkTIFFWriter.h:84
Writes images to files.
static vtkImageWriter * New()
double YResolution
Definition: vtkTIFFWriter.h:85
virtual void WriteFileTrailer(ostream *, vtkImageData *)