NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
compress.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  libvideo: a library for SDI video processing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #pragma once
16 #ifndef LIBVIDEO_COMPRESS_H_51C60B61F0E2444388408FB2BD1F737A
17 #define LIBVIDEO_COMPRESS_H_51C60B61F0E2444388408FB2BD1F737A
18 
19 #include <string>
20 #include <exception>
21 #include <video/dllexport.h>
22 
23 
24 namespace video
25 {
26 
27 
28 #pragma warning(push)
29 #pragma warning(disable: 4275) // non dll-interface class '...' used as base for dll-interface class '...'
30 
31 // specifically the compressor engine returned error codes
32 // for functions that should not fail during normal operations
33 class LIBVIDEO_DLL_EXPORTS CompressorFailedException : public std::runtime_error
34 {
35 public:
36  CompressorFailedException(const std::string& msg, int errorcode);
37 };
38 
39 // functionality required to map buffers/textures/etc for compression failed
40 class LIBVIDEO_DLL_EXPORTS InteropFailedException : public std::runtime_error
41 {
42 public:
43  InteropFailedException(const std::string& msg, int errorcode);
44 };
45 
46 #pragma warning(pop)
47 
48 
49 // forward-decl for pimpl
50 class CompressorImpl;
51 
52 
53 // this matches what the nvidia compressor uses internally
54 struct FrameType
55 {
56  enum FT
57  {
58  I = 1,
59  P = 2,
60  B = 3
61  };
62 };
63 
64 
78 class LIBVIDEO_DLL_EXPORTS Compressor
79 {
80 private:
81  CompressorImpl* pimpl;
82 
83 public:
92  Compressor(int width, int height, int mfps, const std::string& filename);
93  ~Compressor();
94 
95 private:
96  // not implemented
97  Compressor(const Compressor& copyme);
98  Compressor& operator=(const Compressor& assignme);
99 
100 
101 public:
102 
106  void compresstexture(int gltexture);
107 
111  void preparetexture(int gltexture);
112 
113 
114 public:
119  bool get_output_info(unsigned int frameno, unsigned __int64* fileoffset, FrameType::FT* frametype);
120 };
121 
122 
123 } // namespace
124 
125 #endif // LIBVIDEO_COMPRESS_H_51C60B61F0E2444388408FB2BD1F737A
Definition: compress.h:78
Definition: compress.h:33
Definition: compress.h:40
Definition: compress.h:54
FT
Definition: compress.h:56
Definition: compress.cxx:30
Definition: compress.h:58
GLint GLint GLint GLint GLint GLint GLsizei GLsizei height
Definition: glew.h:1236
Definition: compress.cxx:94
Definition: compress.h:59
Definition: compress.h:60
GLint GLint GLint GLint GLint GLint GLsizei width
Definition: glew.h:1236
GLsizei const GLcharARB ** string
Definition: glew.h:5194