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 =========================================================================*/
35 #ifndef vtkDataEncoder_h
36 #define vtkDataEncoder_h
37 
38 #include "vtkObject.h"
39 #include "vtkWebCoreModule.h" // needed for exports
40 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
41 
43 class vtkImageData;
44 
46 {
47 public:
48  static vtkDataEncoder* New();
49  vtkTypeMacro(vtkDataEncoder, vtkObject);
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
54  void Initialize();
55 
62  void PushAndTakeReference(vtkTypeUInt32 key, vtkImageData* &data, int quality);
63 
69  bool GetLatestOutput(vtkTypeUInt32 key,vtkSmartPointer<vtkUnsignedCharArray>& data);
70 
75  void Flush(vtkTypeUInt32 key);
76 
79  const char* EncodeAsBase64Png(vtkImageData* img, int compressionLevel=5);
80 
83  const char* EncodeAsBase64Jpg(vtkImageData* img, int quality=50);
84 
85 //BTX
86 protected:
88  ~vtkDataEncoder();
89 
90 private:
91  vtkDataEncoder(const vtkDataEncoder&); // Not implemented
92  void operator=(const vtkDataEncoder&); // Not implemented
93 
94  class vtkInternals;
95  vtkInternals* Internals;
96 //ETX
97 };
98 
99 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
dynamic, self-adjusting array of unsigned char
class used to compress/encode images using threads.
static vtkObject * New()
#define VTKWEBCORE_EXPORT