summaryrefslogtreecommitdiff
path: root/source/core/slang-compression-system.h
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 14:49:26 +0800
committerGitHub <noreply@github.com>2024-10-29 14:49:26 +0800
commitf65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch)
treeea1d61342cd29368e19135000ec2948813096205 /source/core/slang-compression-system.h
parenta729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff)
format
* format * Minor test fixes * enable checking cpp format in ci
Diffstat (limited to 'source/core/slang-compression-system.h')
-rw-r--r--source/core/slang-compression-system.h62
1 files changed, 38 insertions, 24 deletions
diff --git a/source/core/slang-compression-system.h b/source/core/slang-compression-system.h
index ecc5b1be9..806228f64 100644
--- a/source/core/slang-compression-system.h
+++ b/source/core/slang-compression-system.h
@@ -10,13 +10,14 @@ struct CompressionStyle
{
enum class Type
{
- Level, ///< Use the value specified in 'level' to control compression
- BestSpeed, ///< Best for speed (typically lower compression ration)
- BestCompression, ///< Best compression (typically slower)
- Default, ///< Default compression (a good balance between speed and size)
+ Level, ///< Use the value specified in 'level' to control compression
+ BestSpeed, ///< Best for speed (typically lower compression ration)
+ BestCompression, ///< Best compression (typically slower)
+ Default, ///< Default compression (a good balance between speed and size)
};
- Type m_type = Type::Default; ///< The type
- float m_level = 1.0f; ///< 0 lowest compression, 1 highest compression (Ignored if m_type != Type::Level)
+ Type m_type = Type::Default; ///< The type
+ float m_level =
+ 1.0f; ///< 0 lowest compression, 1 highest compression (Ignored if m_type != Type::Level)
};
enum class CompressionSystemType
@@ -29,28 +30,41 @@ enum class CompressionSystemType
class ICompressionSystem : public ISlangUnknown
{
- SLANG_COM_INTERFACE(0xcc935840, 0xe059, 0x4bb8, { 0xa2, 0x2d, 0x92, 0x7b, 0x3c, 0x73, 0x8f, 0x85 })
+ SLANG_COM_INTERFACE(
+ 0xcc935840,
+ 0xe059,
+ 0x4bb8,
+ {0xa2, 0x2d, 0x92, 0x7b, 0x3c, 0x73, 0x8f, 0x85})
- /** Get the compression system type
- @return The compression system type */
+ /** Get the compression system type
+ @return The compression system type */
virtual SLANG_NO_THROW CompressionSystemType SLANG_MCALL getSystemType() = 0;
- /** compress
- @param src Points to the start of the data to compress
- @param srcSizeInBytes The size of the source data to compress in bytes
- @param outBlob The input data compressed
- @return SLANG_OK if successful */
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL compress(const CompressionStyle* style, const void* src, size_t srcSizeInBytes, ISlangBlob** outBlob) = 0;
-
- /* decompress
- @param compressed The start of the compressed data
- @param compressedSizeInBytes The compressed size in bytes
- @param decompressedSizeInBytes The size of the decompressed buffer. MUST be exactly the same as the original source size.
- @param outDecompressed Where decompressed data is written
- @return SLANG_OK if successful */
- virtual SLANG_NO_THROW SlangResult SLANG_MCALL decompress(const void* compressed, size_t compressedSizeInBytes, size_t decompressedSizeInBytes, void* outDecompressed) = 0;
+ /** compress
+ @param src Points to the start of the data to compress
+ @param srcSizeInBytes The size of the source data to compress in bytes
+ @param outBlob The input data compressed
+ @return SLANG_OK if successful */
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL compress(
+ const CompressionStyle* style,
+ const void* src,
+ size_t srcSizeInBytes,
+ ISlangBlob** outBlob) = 0;
+
+ /* decompress
+ @param compressed The start of the compressed data
+ @param compressedSizeInBytes The compressed size in bytes
+ @param decompressedSizeInBytes The size of the decompressed buffer. MUST be exactly the same as
+ the original source size.
+ @param outDecompressed Where decompressed data is written
+ @return SLANG_OK if successful */
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL decompress(
+ const void* compressed,
+ size_t compressedSizeInBytes,
+ size_t decompressedSizeInBytes,
+ void* outDecompressed) = 0;
};
-}
+} // namespace Slang
#endif