Lunchbox  1.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
uploader.h
1 
2 /* Copyright (c) 2013-2014, Stefan.Eilemann@epfl.ch
3  *
4  * This file is part of Lunchbox <https://github.com/Eyescale/Lunchbox>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef LUNCHBOX_UPLOADER_H
21 #define LUNCHBOX_UPLOADER_H
22 
23 #include <lunchbox/api.h>
24 #include <lunchbox/types.h>
25 #include <lunchbox/thread.h> // thread-safety macros
26 
27 namespace lunchbox
28 {
29 namespace detail { class Uploader; }
30 
32 class Uploader : public boost::noncopyable
33 {
34 public:
36  LUNCHBOX_API Uploader();
37 
45  LUNCHBOX_API Uploader( PluginRegistry& from, const uint32_t name );
46 
48  LUNCHBOX_API virtual ~Uploader();
49 
51  LUNCHBOX_API bool isGood( const GLEWContext* gl ) const;
52 
57  LUNCHBOX_API bool uses( const uint32_t name ) const;
58 
63  LUNCHBOX_API bool supports( const uint32_t externalFormat,
64  const uint32_t internalFormat,
65  const uint64_t capabilities,
66  const GLEWContext* gl ) const;
67 
76  static LUNCHBOX_API uint32_t choose( const PluginRegistry& from,
77  const uint32_t externalFormat,
78  const uint32_t internalFormat,
79  const uint64_t capabilities,
80  const GLEWContext* gl );
81 
83  LUNCHBOX_API const EqCompressorInfo& getInfo() const;
84 
93  LUNCHBOX_API bool setup( PluginRegistry& from, const uint32_t name );
94 
100  LUNCHBOX_API bool setup( PluginRegistry& from,
101  const uint32_t externalFormat,
102  const uint32_t internalFormat,
103  const uint64_t capabilities,
104  const GLEWContext* gl );
105 
107  LUNCHBOX_API void clear();
108 
120  LUNCHBOX_API void upload( const void* buffer, const uint64_t inDims[4],
121  const uint64_t flags, const uint64_t outDims[4],
122  const unsigned destination,
123  const GLEWContext* gl );
124 private:
125  detail::Uploader* const impl_;
126  LB_TS_VAR( _thread );
127 };
128 }
129 #endif // LUNCHBOX_UPLOADER_H
A registry for loaded plugins.
Defines export visibility macros for Lunchbox.
Basic type definitions not provided by the operating system.
static LUNCHBOX_API uint32_t choose(const PluginRegistry &from, const uint32_t externalFormat, const uint32_t internalFormat, const uint64_t capabilities, const GLEWContext *gl)
Find the best uploader in all plugins for the given parameters.
LUNCHBOX_API const EqCompressorInfo & getInfo() const
LUNCHBOX_API bool setup(PluginRegistry &from, const uint32_t name)
Set up a new, named uploader instance.
Information about one compressor.
virtual LUNCHBOX_API ~Uploader()
Destruct this uploader.
LUNCHBOX_API bool isGood(const GLEWContext *gl) const
LUNCHBOX_API Uploader()
Construct a new, invalid uploader instance.
LUNCHBOX_API void clear()
Reset to EQ_COMPRESSOR_NONE.
LUNCHBOX_API void upload(const void *buffer, const uint64_t inDims[4], const uint64_t flags, const uint64_t outDims[4], const unsigned destination, const GLEWContext *gl)
Upload data from cpu to the frame buffer or texture.
A C++ class to handle one uploader plugin instance.
Definition: uploader.h:32
LUNCHBOX_API bool supports(const uint32_t externalFormat, const uint32_t internalFormat, const uint64_t capabilities, const GLEWContext *gl) const
LUNCHBOX_API bool uses(const uint32_t name) const