compressorRLE4B.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EQ_PLUGIN_COMPRESSORRLE4B
00020 #define EQ_PLUGIN_COMPRESSORRLE4B
00021
00022 #include "compressor.h"
00023
00024 namespace eq
00025 {
00026 namespace plugin
00027 {
00028
00029 class CompressorRLE4B : public Compressor
00030 {
00031 public:
00032 CompressorRLE4B() {}
00033 virtual ~CompressorRLE4B() {}
00034
00035 virtual void compress( const void* const inData, const eq_uint64_t nPixels,
00036 const bool useAlpha )
00037 { compress( inData, nPixels, useAlpha, false ); }
00038
00039 static void decompress( const void* const* inData,
00040 const eq_uint64_t* const inSizes,
00041 const unsigned nInputs, void* const outData,
00042 const eq_uint64_t nPixels, const bool useAlpha );
00043
00044
00045 static void* getNewCompressor( ){ return new eq::plugin::CompressorRLE4B; }
00046 static void* getNewDecompressor( ){ return 0; }
00047
00048 static void getInfo( EqCompressorInfo* const info )
00049 {
00050 info->version = EQ_COMPRESSOR_VERSION;
00051 info->name = EQ_COMPRESSOR_RLE_4_BYTE;
00052 info->capabilities = EQ_COMPRESSOR_DATA_1D | EQ_COMPRESSOR_DATA_2D |
00053 EQ_COMPRESSOR_IGNORE_MSE;
00054 info->tokenType = EQ_COMPRESSOR_DATATYPE_4_BYTE;
00055
00056 info->quality = 1.0f;
00057 info->ratio = .59f;
00058 info->speed = 1.0f;
00059 }
00060
00061 static Functions getFunctions()
00062 {
00063 Functions functions;
00064 functions.name = EQ_COMPRESSOR_RLE_4_BYTE;
00065 functions.getInfo = getInfo;
00066 functions.newCompressor = getNewCompressor;
00067 functions.decompress = decompress;
00068 return functions;
00069 }
00070
00071 protected:
00072 void compress( const void* const inData, const eq_uint64_t nPixels,
00073 const bool useAlpha, const bool swizzle );
00074 };
00075
00076
00077
00078 class CompressorDiffRLE4B : public CompressorRLE4B
00079 {
00080 public:
00081 CompressorDiffRLE4B() {}
00082 virtual ~CompressorDiffRLE4B() {}
00083
00090 static void* getNewCompressor( )
00091 { return new eq::plugin::CompressorDiffRLE4B; }
00092
00099 static void* getNewDecompressor( ){ return 0; }
00100
00108 static void getInfo( EqCompressorInfo* const info )
00109 {
00110 CompressorRLE4B::getInfo( info );
00111 info->name = EQ_COMPRESSOR_DIFF_RLE_4_BYTE;
00112 info->ratio = 0.50f;
00113 info->speed = 1.1f;
00114 }
00115
00123 static Functions getFunctions()
00124 {
00125 Functions functions;
00126 functions.name = EQ_COMPRESSOR_DIFF_RLE_4_BYTE;
00127 functions.getInfo = getInfo;
00128 functions.newCompressor = getNewCompressor;
00129 functions.decompress = decompress;
00130 return functions;
00131 }
00132
00133 virtual void compress( const void* const inData, const eq_uint64_t nPixels,
00134 const bool useAlpha )
00135 { CompressorRLE4B::compress( inData, nPixels, useAlpha, true ); }
00136
00137 static void decompress( const void* const* inData,
00138 const eq_uint64_t* const inSizes,
00139 const unsigned nInputs, void* const outData,
00140 const eq_uint64_t nPixels, const bool useAlpha );
00141 };
00142 }
00143 }
00144 #endif // EQ_PLUGIN_COMPRESSORRLE4B