vtkNvPipeCompressor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) 2016-2017, NVIDIA CORPORATION
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 // .NAME vtkNvPipeCompressor - Image compressor/decompressor using NvPipe.
6 // .SECTION Description
7 // This class compresses image data using NvPipe, a library that takes advantage
8 // of NVIDIA GPU's hardware-based video [de]compression hardware.
9 // .SECTION Thanks
10 // NVIDIA CORPORATION contributed this class.
11 
12 #ifndef vtkNvPipeCompressor_h
13 #define vtkNvPipeCompressor_h
14 
15 #include "vtkImageCompressor.h"
16 #include "vtkPVVTKExtensionsFiltersRenderingModule.h" // needed for export macro
17 
19 typedef void nvpipe;
20 
22 {
23 public:
24  static vtkNvPipeCompressor* New();
26  void PrintSelf(ostream& os, vtkIndent indent) override;
27 
29 
34  vtkSetClampMacro(Quality, unsigned int, 1, 5);
35  vtkGetMacro(Quality, unsigned int);
37 
39  // Description:
40  // Compress/Decompress data array on the objects input with results
41  // in the objects output. See also Set/GetInput/Output.
42  virtual int Compress();
43  virtual int Decompress();
45 
46  void SetImageResolution(int img_width, int img_height);
47 
51  virtual void SaveConfiguration(vtkMultiProcessStream* stream);
52  virtual bool RestoreConfiguration(vtkMultiProcessStream* stream);
53  virtual const char* SaveConfiguration();
54  virtual const char* RestoreConfiguration(const char* stream);
56 
57 protected:
59  virtual ~vtkNvPipeCompressor();
60 
61  unsigned int Quality;
62 
63 private:
64  size_t Width;
65  size_t Height;
66  nvpipe* Pipe;
67  uint64_t Bitrate;
68 
69 private:
71  void operator=(const vtkNvPipeCompressor&) = delete;
72 };
73 #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