VTK  9.2.6
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 =========================================================================*/
39 #ifndef vtkJPEGWriter_h
40 #define vtkJPEGWriter_h
41 
42 #include "vtkIOImageModule.h" // For export macro
43 #include "vtkImageWriter.h"
44 
46 class vtkImageData;
47 
48 class VTKIOIMAGE_EXPORT vtkJPEGWriter : public vtkImageWriter
49 {
50 public:
51  static vtkJPEGWriter* New();
52  vtkTypeMacro(vtkJPEGWriter, vtkImageWriter);
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
58  void Write() override;
59 
61 
64  vtkSetClampMacro(Quality, int, 0, 100);
65  vtkGetMacro(Quality, int);
67 
69 
72  vtkSetMacro(Progressive, vtkTypeUBool);
73  vtkGetMacro(Progressive, vtkTypeUBool);
74  vtkBooleanMacro(Progressive, vtkTypeUBool);
76 
78 
81  vtkSetMacro(WriteToMemory, vtkTypeUBool);
82  vtkGetMacro(WriteToMemory, vtkTypeUBool);
83  vtkBooleanMacro(WriteToMemory, vtkTypeUBool);
85 
87 
92  vtkGetObjectMacro(Result, vtkUnsignedCharArray);
94 
95 protected:
97  ~vtkJPEGWriter() override;
98 
99  void WriteSlice(vtkImageData* data, int* uExtent);
100 
101 private:
102  int Quality;
103  vtkTypeUBool Progressive;
104  vtkUnsignedCharArray* Result;
105  FILE* TempFP;
106 
107 private:
108  vtkJPEGWriter(const vtkJPEGWriter&) = delete;
109  void operator=(const vtkJPEGWriter&) = delete;
110 };
111 
112 #endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:63
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:49
Writes JPEG files.
Definition: vtkJPEGWriter.h:49
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