yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1#ifndef SLANG_COMPRESSION_SYSTEM_H 2#define SLANG_COMPRESSION_SYSTEM_H 3 4#include "slang-basic.h" 5 6namespace Slang 7{ 8 9struct CompressionStyle 10{ 11enum class Type 12 { 13Level ,///< Use the value specified in 'level' to control compression 14BestSpeed ,///< Best for speed (typically lower compression ration) 15BestCompression ,///< Best compression (typically slower) 16Default ,///< Default compression (a good balance between speed and size) 17 }; 18Type m_type = Type ::Default ;///< The type 19float m_level = 201.0f ;///< 0 lowest compression, 1 highest compression (Ignored if m_type != Type::Level) 21}; 22 23enum class CompressionSystemType 24{ 25None , 26Deflate , 27LZ4 , 28CountOf , 29}; 30 31class ICompressionSystem :public ISlangUnknown 32{ 33SLANG_COM_INTERFACE ( 340xcc935840 , 350xe059 , 360x4bb8 , 37 {0xa2 ,0x2d ,0x92 ,0x7b ,0x3c ,0x73 ,0x8f ,0x85 }) 38 39/** Get the compression system type 40@return The compression system type */ 41virtual SLANG_NO_THROW CompressionSystemType SLANG_MCALL getSystemType ()= 0 ; 42 43/** compress 44@param src Points to the start of the data to compress 45@param srcSizeInBytes The size of the source data to compress in bytes 46@param outBlob The input data compressed 47@return SLANG_OK if successful */ 48virtual SLANG_NO_THROW SlangResult SLANG_MCALL compress ( 49const CompressionStyle * style , 50const void * src , 51size_t srcSizeInBytes , 52ISlangBlob ** outBlob )= 0 ; 53 54/* decompress 55@param compressed The start of the compressed data 56@param compressedSizeInBytes The compressed size in bytes 57@param decompressedSizeInBytes The size of the decompressed buffer. MUST be exactly the same as 58the original source size. 59@param outDecompressed Where decompressed data is written 60@return SLANG_OK if successful */ 61virtual SLANG_NO_THROW SlangResult SLANG_MCALL decompress ( 62const void * compressed , 63size_t compressedSizeInBytes , 64size_t decompressedSizeInBytes , 65void * outDecompressed )= 0 ; 66}; 67 68}// namespace Slang 69 70#endif