Line data Source code
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/gl.h>
25 : #include <eq/util/texture.h>
26 : #include <eq/util/types.h>
27 : #include <lunchbox/buffer.h>
28 :
29 : namespace eq
30 : {
31 : namespace plugin
32 : {
33 : class CompressorYUV : public Compressor
34 : {
35 : public:
36 : CompressorYUV();
37 : virtual ~CompressorYUV();
38 :
39 0 : static void* getNewCompressor(const unsigned) { return new CompressorYUV; }
40 0 : static void* getNewDecompressor(const unsigned)
41 : {
42 0 : return new CompressorYUV;
43 : }
44 :
45 0 : void compress(const void* const, const eq_uint64_t, const bool) override
46 : {
47 0 : LBDONTCALL;
48 0 : }
49 :
50 : static bool isCompatible(const GLEWContext*);
51 :
52 : void download(const GLEWContext*, const eq_uint64_t*, const unsigned,
53 : const eq_uint64_t, eq_uint64_t*, void**) override;
54 :
55 : void upload(const GLEWContext*, const void*, const eq_uint64_t*,
56 : const eq_uint64_t, const eq_uint64_t*, const unsigned) override;
57 :
58 : protected:
59 : GLuint _program;
60 : lunchbox::Bufferb buffer;
61 :
62 : private:
63 : void _initShader(const GLEWContext*, const char*);
64 : void _compress(const GLEWContext*, const eq_uint64_t*, eq_uint64_t*);
65 : void _decompress(const GLEWContext*, const eq_uint64_t*);
66 : void _download(void*);
67 :
68 : util::FrameBufferObject* _fbo;
69 : util::Texture* _texture;
70 : };
71 : }
72 : }
73 : #endif // EQ_PLUGIN_COMPRESSORYUV
|