VTK  9.3.1
vtkTIFFWriter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
18 #ifndef vtkTIFFWriter_h
19 #define vtkTIFFWriter_h
20 
21 #include "vtkIOImageModule.h" // For export macro
22 #include "vtkImageWriter.h"
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class VTKIOIMAGE_EXPORT vtkTIFFWriter : public vtkImageWriter
26 {
27 public:
28  static vtkTIFFWriter* New();
29  vtkTypeMacro(vtkTIFFWriter, vtkImageWriter);
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
35  void Write() override;
36 
37  enum
38  { // Compression types
43  LZW
44  };
45 
47 
51  vtkSetClampMacro(Compression, int, NoCompression, LZW);
52  vtkGetMacro(Compression, int);
53  void SetCompressionToNoCompression() { this->SetCompression(NoCompression); }
54  void SetCompressionToPackBits() { this->SetCompression(PackBits); }
55  void SetCompressionToJPEG() { this->SetCompression(JPEG); }
56  void SetCompressionToDeflate() { this->SetCompression(Deflate); }
57  void SetCompressionToLZW() { this->SetCompression(LZW); }
59 
60 protected:
61  vtkTIFFWriter();
62  ~vtkTIFFWriter() override = default;
63 
64  void WriteFile(ostream* file, vtkImageData* data, int ext[6], int wExt[6]) override;
65  void WriteFileHeader(ostream*, vtkImageData*, int wExt[6]) override;
66  void WriteFileTrailer(ostream*, vtkImageData*) override;
67 
68  void* TIFFPtr;
70  int Width;
71  int Height;
72  int Pages;
73  double XResolution;
74  double YResolution;
75 
76 private:
77  vtkTIFFWriter(const vtkTIFFWriter&) = delete;
78  void operator=(const vtkTIFFWriter&) = delete;
79 
80  template <typename T>
81  void WriteVolume(T* buffer);
82 };
83 
84 VTK_ABI_NAMESPACE_END
85 #endif
void SetCompressionToDeflate()
Set compression type.
Definition: vtkTIFFWriter.h:56
virtual void WriteFileHeader(ostream *, vtkImageData *, int[6])
write out image data as a TIFF file
Definition: vtkTIFFWriter.h:25
virtual void WriteFile(ostream *file, vtkImageData *data, int extent[6], int wExtent[6])
void SetCompressionToLZW()
Set compression type.
Definition: vtkTIFFWriter.h:57
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:28
void SetCompressionToNoCompression()
Set compression type.
Definition: vtkTIFFWriter.h:53
void SetCompressionToJPEG()
Set compression type.
Definition: vtkTIFFWriter.h:55
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
virtual void Write()
The main interface which triggers the writer to start.
void SetCompressionToPackBits()
Set compression type.
Definition: vtkTIFFWriter.h:54
double XResolution
Definition: vtkTIFFWriter.h:73
Writes images to files.
static vtkImageWriter * New()
double YResolution
Definition: vtkTIFFWriter.h:74
virtual void WriteFileTrailer(ostream *, vtkImageData *)