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) VTK_OVERRIDE;
45 
49  virtual void Write();
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();
76 
77  virtual void WriteFile(ofstream *file, vtkImageData *data, int ext[6], int wExt[6]);
78  virtual void WriteFileHeader(ofstream *, vtkImageData *, int wExt[6]);
79  virtual void WriteFileTrailer(ofstream *, vtkImageData *);
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&) VTK_DELETE_FUNCTION;
91  void operator=(const vtkTIFFWriter&) VTK_DELETE_FUNCTION;
92 
93  template<typename T> void WriteVolume(T *buffer);
94 };
95 
96 #endif
97 
virtual void WriteFile(ofstream *file, vtkImageData *data, int extent[6], int wExtent[6])
virtual void WriteFileTrailer(ofstream *, vtkImageData *)
void SetCompressionToDeflate()
Set compression type.
Definition: vtkTIFFWriter.h:69
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:39
void SetCompressionToLZW()
Set compression type.
Definition: vtkTIFFWriter.h:70
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()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
double YResolution
Definition: vtkTIFFWriter.h:87
virtual void WriteFileHeader(ofstream *, vtkImageData *, int[6])