VTK
vtkDataEncoder.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataEncoder.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 vtkDataEncoder_h
34 #define vtkDataEncoder_h
35 
36 #include "vtkObject.h"
37 #include "vtkWebCoreModule.h" // needed for exports
38 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
39 
41 class vtkImageData;
42 
43 class VTKWEBCORE_EXPORT vtkDataEncoder : public vtkObject
44 {
45 public:
46  static vtkDataEncoder* New();
47  vtkTypeMacro(vtkDataEncoder, vtkObject);
48  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
49 
54  void Initialize();
55 
64  void PushAndTakeReference(vtkTypeUInt32 key, vtkImageData* &data, int quality);
65 
73  bool GetLatestOutput(vtkTypeUInt32 key,vtkSmartPointer<vtkUnsignedCharArray>& data);
74 
81  void Flush(vtkTypeUInt32 key);
82 
86  const char* EncodeAsBase64Png(vtkImageData* img, int compressionLevel=5);
87 
91  const char* EncodeAsBase64Jpg(vtkImageData* img, int quality=50);
92 
93 protected:
95  ~vtkDataEncoder();
96 
97 private:
98  vtkDataEncoder(const vtkDataEncoder&) VTK_DELETE_FUNCTION;
99  void operator=(const vtkDataEncoder&) VTK_DELETE_FUNCTION;
100 
101  class vtkInternals;
102  vtkInternals* Internals;
103 
104 };
105 
106 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:53
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
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
dynamic, self-adjusting array of unsigned char
class used to compress/encode images using threads.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...