Lunchbox  1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
decompressor.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_DECOMPRESSOR_H
21 #define LUNCHBOX_DECOMPRESSOR_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 Decompressor; }
30 
36 class Decompressor : public boost::noncopyable
37 {
38  typedef detail::Decompressor* const Decompressor::*bool_t;
39 
40 public:
42  LUNCHBOX_API Decompressor();
43 
51  LUNCHBOX_API Decompressor( PluginRegistry& from, const uint32_t name );
52 
54  LUNCHBOX_API virtual ~Decompressor();
55 
57  LUNCHBOX_API bool isGood() const;
58 
63  operator bool_t() const { return isGood() ? &Decompressor::impl_ : 0; }
64 
66  bool operator ! () const { return !isGood(); }
67 
72  LUNCHBOX_API bool uses( const uint32_t name ) const;
73 
75  LUNCHBOX_API const EqCompressorInfo& getInfo() const;
76 
85  LUNCHBOX_API bool setup( PluginRegistry& from, const uint32_t name );
86 
88  LUNCHBOX_API void clear();
89 
101  LUNCHBOX_API void decompress( const void* const* in,
102  const uint64_t* const inSizes,
103  const unsigned numInputs, void* const out,
104  uint64_t outDim[2] );
118  LUNCHBOX_API bool decompress( const CompressorResult& input,
119  void* const out, uint64_t pvpOut[4],
120  const uint64_t flags );
121  LUNCHBOX_API void decompress( const void* const* in,
122  const uint64_t* const inSizes,
123  const unsigned numInputs, void* const out,
124  uint64_t pvpOut[4], const uint64_t flags )
125  LB_DEPRECATED;
126 
127 private:
128  detail::Decompressor* const impl_;
129  LB_TS_VAR( _thread );
130 };
131 }
132 #endif // LUNCHBOX_DECOMPRESSOR_H
A registry for loaded plugins.
Defines export visibility macros for Lunchbox.
Basic type definitions not provided by the operating system.
LUNCHBOX_API void clear()
Reset to EQ_COMPRESSOR_NONE.
LUNCHBOX_API bool setup(PluginRegistry &from, const uint32_t name)
Set up a new, named decompressor instance.
LUNCHBOX_API void decompress(const void *const *in, const uint64_t *const inSizes, const unsigned numInputs, void *const out, uint64_t outDim[2])
Decompress one-dimensional data.
bool operator!() const
Definition: decompressor.h:66
Information about one compressor.
virtual LUNCHBOX_API ~Decompressor()
Destruct this decompressor.
A C++ class to handle one decompressor plugin instance.
Definition: decompressor.h:36
LUNCHBOX_API bool isGood() const
LUNCHBOX_API const EqCompressorInfo & getInfo() const
LUNCHBOX_API Decompressor()
Construct a new, invalid decompressor instance.
LUNCHBOX_API bool uses(const uint32_t name) const
A structure to hold the results from one compress operation.