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