vtkNvPipeCompressor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkNvPipeCompressor.h
5 
6  Copyright (c) 2016-2017, NVIDIA CORPORATION.
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 =========================================================================*/
15 
16 // .NAME vtkNvPipeCompressor - Image compressor/decompressor using NvPipe.
17 // .SECTION Description
18 // This class compresses image data using NvPipe, a library that takes advantage
19 // of NVIDIA GPU's hardware-based video [de]compression hardware.
20 // .SECTION Thanks
21 // NVIDIA CORPORATION contributed this class.
22 
23 #ifndef vtkNvPipeCompressor_h
24 #define vtkNvPipeCompressor_h
25 
26 #include "vtkImageCompressor.h"
27 #include "vtkPVVTKExtensionsFiltersRenderingModule.h" // needed for export macro
28 
30 typedef void nvpipe;
31 
33 {
34 public:
35  static vtkNvPipeCompressor* New();
37  void PrintSelf(std::ostream& os, vtkIndent indent) override;
38 
40 
45  vtkSetClampMacro(Quality, unsigned int, 1, 5);
46  vtkGetMacro(Quality, unsigned int);
48 
50  // Description:
51  // Compress/Decompress data array on the objects input with results
52  // in the objects output. See also Set/GetInput/Output.
53  virtual int Compress();
54  virtual int Decompress();
56 
57  void SetImageResolution(int img_width, int img_height);
58 
60  virtual void SaveConfiguration(vtkMultiProcessStream* stream);
63  virtual bool RestoreConfiguration(vtkMultiProcessStream* stream);
64  virtual const char* SaveConfiguration();
65  virtual const char* RestoreConfiguration(const char* stream);
67 
68 protected:
70  virtual ~vtkNvPipeCompressor();
71 
72  unsigned int Quality;
73 
74 private:
75  size_t Width;
76  size_t Height;
77  nvpipe* Pipe;
78  uint64_t Bitrate;
79 
80 private:
82  void operator=(const vtkNvPipeCompressor&) = delete;
83 };
84 #endif
virtual int Decompress()=0
Decompresses and geenartes the decompressed data as output.
virtual const char * SaveConfiguration()
Serialize compressor configuration (but not the data) into the stream.
Superclass for image compressor/decompressor used by Composite Managers.
void nvpipe
virtual void SetImageResolution(int width, int height)
Communicates the next expected image resolution.
virtual bool RestoreConfiguration(vtkMultiProcessStream *stream)
Restore state from the stream.
#define VTKPVVTKEXTENSIONSFILTERSRENDERING_EXPORT
virtual int Compress()=0
Call this method to compress the input and generate the compressed data.
static vtkObject * New()
void PrintSelf(ostream &os, vtkIndent indent) override