Equalizer  1.9.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
compressorYUV.h
1 
2 /* Copyright (c) 2009, Cedric Stalder <cedric.stalder@gmail.com>
3  * 2013, Stefan Eilemann <eile@eyescale.ch>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQ_PLUGIN_COMPRESSORYUV
20 #define EQ_PLUGIN_COMPRESSORYUV
21 
22 #include "compressor.h"
23 
24 #include <eq/util/texture.h>
25 #include <eq/gl.h>
26 #include <eq/util/types.h>
27 #include <lunchbox/buffer.h>
28 
29 namespace eq
30 {
31 namespace plugin
32 {
33 
34 class CompressorYUV : public Compressor
35 {
36 public:
37  CompressorYUV();
38  virtual ~CompressorYUV();
39 
40  static void* getNewCompressor( const unsigned )
41  { return new CompressorYUV; }
42  static void* getNewDecompressor( const unsigned )
43  { return new CompressorYUV; }
44 
45  virtual void compress( const void* const, const uint64_t, const bool )
46  { LBDONTCALL; }
47 
48  static bool isCompatible( const GLEWContext* );
49 
50  void download( const GLEWContext*, const eq_uint64_t*, const unsigned,
51  const eq_uint64_t, eq_uint64_t*, void** ) override;
52 
53  void upload( const GLEWContext*, const void*, const eq_uint64_t*,
54  const eq_uint64_t, const eq_uint64_t*,
55  const unsigned ) override;
56 
57 protected:
58  GLuint _program;
59  lunchbox::Bufferb buffer;
60 
61 private:
62  void _initShader( const GLEWContext*, const char* );
63  void _compress( const GLEWContext*, const eq_uint64_t*, eq_uint64_t* );
64  void _decompress( const GLEWContext*, const eq_uint64_t* );
65  void _download( void* );
66 
68  util::Texture* _texture;
69 
70 };
71 
72 }
73 }
74 #endif //EQ_PLUGIN_COMPRESSORYUV
A C++ class to abstract OpenGL frame buffer objects.
A wrapper around OpenGL textures.
Definition: texture.h:38
Compression plugin provided with Equalizer.
Includes OpenGL and GLEW headers.