VTK  9.0.1
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:
69  vtkTIFFWriter();
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
void SetCompressionToDeflate()
Set compression type.
Definition: vtkTIFFWriter.h:64
virtual void WriteFileHeader(ostream *, vtkImageData *, int[6])
~vtkTIFFWriter() override
Definition: vtkTIFFWriter.h:70
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:33
virtual void WriteFile(ostream *file, vtkImageData *data, int extent[6], int wExtent[6])
void SetCompressionToLZW()
Set compression type.
Definition: vtkTIFFWriter.h:65
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:33
void SetCompressionToNoCompression()
Set compression type.
Definition: vtkTIFFWriter.h:61
void SetCompressionToJPEG()
Set compression type.
Definition: vtkTIFFWriter.h:63
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
virtual void Write()
The main interface which triggers the writer to start.
void SetCompressionToPackBits()
Set compression type.
Definition: vtkTIFFWriter.h:62
double XResolution
Definition: vtkTIFFWriter.h:81
Writes images to files.
static vtkImageWriter * New()
double YResolution
Definition: vtkTIFFWriter.h:82
virtual void WriteFileTrailer(ostream *, vtkImageData *)