Equalizer 1.0
|
00001 00002 /* Copyright (c) 2009-2010, Cedric Stalder <cedric.stalder@gmail.com> 00003 * 2009-2011, Stefan Eilemann <eile@equalizergraphics.com> 00004 * 00005 * This library is free software; you can redistribute it and/or modify it under 00006 * the terms of the GNU Lesser General Public License version 2.1 as published 00007 * by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, but WITHOUT 00010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00012 * details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with this library; if not, write to the Free Software Foundation, Inc., 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00017 */ 00018 00162 #ifndef EQ_PLUGINS_COMPRESSOR 00163 #define EQ_PLUGINS_COMPRESSOR 00164 00166 #include <sys/types.h> 00167 struct GLEWContextStruct; 00168 struct WGLEWContextStruct; 00169 typedef struct GLEWContextStruct GLEWContext; 00170 typedef struct WGLEWContextStruct WGLEWContext; 00171 typedef unsigned long long eq_uint64_t; 00172 00173 #ifdef _MSC_VER 00174 # ifdef EQ_PLUGIN_BUILD 00175 # define EQ_PLUGIN_API __declspec(dllexport) 00176 # else 00177 # define EQ_PLUGIN_API __declspec(dllimport) 00178 # endif 00179 #else // _WIN32 00180 # define EQ_PLUGIN_API __attribute__ ((visibility("default"))) 00181 #endif 00182 00187 #define EQ_COMPRESSOR_VERSION 3 00188 00189 #define EQ_COMPRESSOR_VERSION_1 1 00190 00191 #define EQ_COMPRESSOR_VERSION_2 1 00192 00193 #define EQ_COMPRESSOR_VERSION_3 1 00194 00196 #include <co/plugins/compressorTokens.h> 00197 #include <co/plugins/compressorTypes.h> 00198 00199 #ifdef __cplusplus 00200 # include <vector> 00201 00202 extern "C" { 00203 #endif 00204 00216 #define EQ_COMPRESSOR_INPLACE 0x1 00217 00221 #define EQ_COMPRESSOR_DATA_1D 0x2 00222 00227 #define EQ_COMPRESSOR_DATA_2D 0x4 00228 00244 #define EQ_COMPRESSOR_IGNORE_ALPHA 0x8 00245 00246 #define EQ_COMPRESSOR_IGNORE_MSE EQ_COMPRESSOR_IGNORE_ALPHA 00247 00254 #define EQ_COMPRESSOR_CPU 0 00255 00262 #define EQ_COMPRESSOR_TRANSFER 0x10 00263 00270 #define EQ_COMPRESSOR_USE_TEXTURE_RECT 0x20 00271 00277 #define EQ_COMPRESSOR_USE_TEXTURE_2D 0x80 00278 00284 #define EQ_COMPRESSOR_USE_FRAMEBUFFER 0x40 00285 00290 struct EqCompressorInfo 00291 { 00300 unsigned version; 00301 00303 unsigned name; 00304 00313 unsigned tokenType; 00314 00316 eq_uint64_t capabilities; 00317 00319 float quality; 00320 00322 float ratio; 00323 00325 float speed; 00326 00339 unsigned outputTokenType; 00340 00342 unsigned outputTokenSize; 00343 }; 00344 00346 EQ_PLUGIN_API size_t EqCompressorGetNumCompressors(); 00347 00361 EQ_PLUGIN_API void EqCompressorGetInfo( const size_t n, 00362 EqCompressorInfo* const info ); 00382 EQ_PLUGIN_API void* EqCompressorNewCompressor( const unsigned name ); 00383 00390 EQ_PLUGIN_API void EqCompressorDeleteCompressor( void* const compressor ); 00391 00405 EQ_PLUGIN_API void* EqCompressorNewDecompressor( const unsigned name ); 00412 EQ_PLUGIN_API void EqCompressorDeleteDecompressor(void* const decompressor); 00440 EQ_PLUGIN_API void EqCompressorCompress( void* const compressor, 00441 const unsigned name, 00442 void* const in, 00443 const eq_uint64_t* inDims, 00444 const eq_uint64_t flags ); 00445 00457 EQ_PLUGIN_API unsigned EqCompressorGetNumResults( void* const compressor, 00458 const unsigned name ); 00459 00470 EQ_PLUGIN_API void EqCompressorGetResult( void* const compressor, 00471 const unsigned name, 00472 const unsigned i, 00473 void** const out, 00474 eq_uint64_t* const outSize ); 00475 00496 EQ_PLUGIN_API void EqCompressorDecompress( void* const decompressor, 00497 const unsigned name, 00498 const void* const* in, 00499 const eq_uint64_t* const inSizes, 00500 const unsigned numInputs, 00501 void* const out, 00502 eq_uint64_t* const outDims, 00503 const eq_uint64_t flags ); 00522 EQ_PLUGIN_API bool EqCompressorIsCompatible( const unsigned name, 00523 const GLEWContext* glewContext ); 00524 00572 EQ_PLUGIN_API void EqCompressorDownload( void* const compressor, 00573 const unsigned name, 00574 const GLEWContext* glewContext, 00575 const eq_uint64_t inDims[4], 00576 const unsigned source, 00577 const eq_uint64_t flags, 00578 eq_uint64_t outDims[4], 00579 void** out ); 00580 00622 EQ_PLUGIN_API void EqCompressorUpload( void* const decompressor, 00623 const unsigned name, 00624 const GLEWContext* glewContext, 00625 const void* buffer, 00626 const eq_uint64_t inDims[4], 00627 const eq_uint64_t flags, 00628 const eq_uint64_t outDims[4], 00629 const unsigned destination ); 00631 #ifdef __cplusplus 00632 } 00633 #endif 00634 #endif // EQ_PLUGINS_COMPRESSOR