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 =========================================================================*/
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();
38  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
39 
43  void Write() VTK_OVERRIDE;
44 
45  enum { // Compression types
50  LZW
51  };
52 
54 
58  vtkSetClampMacro(Compression, int, NoCompression, LZW);
59  vtkGetMacro(Compression, int);
60  void SetCompressionToNoCompression() { this->SetCompression(NoCompression); }
61  void SetCompressionToPackBits() { this->SetCompression(PackBits); }
62  void SetCompressionToJPEG() { this->SetCompression(JPEG); }
63  void SetCompressionToDeflate() { this->SetCompression(Deflate); }
64  void SetCompressionToLZW() { this->SetCompression(LZW); }
66 
67 protected:
68  vtkTIFFWriter();
69  ~vtkTIFFWriter() VTK_OVERRIDE {}
70 
71  void WriteFile(ofstream *file, vtkImageData *data, int ext[6], int wExt[6]) VTK_OVERRIDE;
72  void WriteFileHeader(ofstream *, vtkImageData *, int wExt[6]) VTK_OVERRIDE;
73  void WriteFileTrailer(ofstream *, vtkImageData *) VTK_OVERRIDE;
74 
75  void* TIFFPtr;
77  int Width;
78  int Height;
79  int Pages;
80  double XResolution;
81  double YResolution;
82 
83 private:
84  vtkTIFFWriter(const vtkTIFFWriter&) VTK_DELETE_FUNCTION;
85  void operator=(const vtkTIFFWriter&) VTK_DELETE_FUNCTION;
86 
87  template<typename T> void WriteVolume(T *buffer);
88 };
89 
90 #endif
91 
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:63
~vtkTIFFWriter() override
Definition: vtkTIFFWriter.h:69
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:33
void SetCompressionToLZW()
Set compression type.
Definition: vtkTIFFWriter.h:64
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:60
void SetCompressionToJPEG()
Set compression type.
Definition: vtkTIFFWriter.h:62
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
virtual void Write()
The main interface which triggers the writer to start.
void SetCompressionToPackBits()
Set compression type.
Definition: vtkTIFFWriter.h:61
double XResolution
Definition: vtkTIFFWriter.h:80
Writes images to files.
static vtkImageWriter * New()
double YResolution
Definition: vtkTIFFWriter.h:81
virtual void WriteFileHeader(ofstream *, vtkImageData *, int [6])