VTK  9.1.0
vtkJPEGWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkJPEGWriter.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 =========================================================================*/
76 #ifndef vtkJPEGWriter_h
77 #define vtkJPEGWriter_h
78 
79 #include "vtkIOImageModule.h" // For export macro
80 #include "vtkImageWriter.h"
81 
83 class vtkImageData;
84 
85 class VTKIOIMAGE_EXPORT vtkJPEGWriter : public vtkImageWriter
86 {
87 public:
88  static vtkJPEGWriter* New();
89  vtkTypeMacro(vtkJPEGWriter, vtkImageWriter);
90  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
95  void Write() override;
96 
98 
101  vtkSetClampMacro(Quality, int, 0, 100);
102  vtkGetMacro(Quality, int);
104 
106 
109  vtkSetMacro(Progressive, vtkTypeUBool);
110  vtkGetMacro(Progressive, vtkTypeUBool);
111  vtkBooleanMacro(Progressive, vtkTypeUBool);
113 
115 
118  vtkSetMacro(WriteToMemory, vtkTypeUBool);
119  vtkGetMacro(WriteToMemory, vtkTypeUBool);
120  vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
122 
124 
129  vtkGetObjectMacro(Result, vtkUnsignedCharArray);
131 
132 protected:
134  ~vtkJPEGWriter() override;
135 
136  void WriteSlice(vtkImageData* data, int* uExtent);
137 
138 private:
139  int Quality;
140  vtkTypeUBool Progressive;
141  vtkUnsignedCharArray* Result;
142  FILE* TempFP;
143 
144 private:
145  vtkJPEGWriter(const vtkJPEGWriter&) = delete;
146  void operator=(const vtkJPEGWriter&) = delete;
147 };
148 
149 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:113
Writes JPEG files.
Definition: vtkJPEGWriter.h:86
static vtkJPEGWriter * New()
~vtkJPEGWriter() override
virtual void SetResult(vtkUnsignedCharArray *)
When writing to memory this is the result, it will be nullptr until the data is written the first tim...
void WriteSlice(vtkImageData *data, int *uExtent)
void Write() override
The main interface which triggers the writer to start.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of unsigned char
@ data
Definition: vtkX3D.h:321
unsigned int vtkTypeUBool
Definition: vtkABI.h:70