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 =========================================================================*/
36 #ifndef vtkDataEncoder_h
37 #define vtkDataEncoder_h
38 
39 #include "vtkObject.h"
40 #include "vtkWebCoreModule.h" // needed for exports
41 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
42 
44 class vtkImageData;
45 
46 class VTKWEBCORE_EXPORT vtkDataEncoder : public vtkObject
47 {
48 public:
49  static vtkDataEncoder* New();
50  vtkTypeMacro(vtkDataEncoder, vtkObject);
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
57  void Initialize();
58 
67  void PushAndTakeReference(vtkTypeUInt32 key, vtkImageData* &data, int quality);
68 
76  bool GetLatestOutput(vtkTypeUInt32 key,vtkSmartPointer<vtkUnsignedCharArray>& data);
77 
84  void Flush(vtkTypeUInt32 key);
85 
89  const char* EncodeAsBase64Png(vtkImageData* img, int compressionLevel=5);
90 
94  const char* EncodeAsBase64Jpg(vtkImageData* img, int quality=50);
95 
96 protected:
98  ~vtkDataEncoder();
99 
100 private:
101  vtkDataEncoder(const vtkDataEncoder&) VTK_DELETE_FUNCTION;
102  void operator=(const vtkDataEncoder&) VTK_DELETE_FUNCTION;
103 
104  class vtkInternals;
105  vtkInternals* Internals;
106 
107 };
108 
109 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
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...