rtengine/src/runtime/compression.h
2024-02-04 17:26:51 +01:00

39 lines
1.0 KiB
C

#ifndef RT_COMPRESSION_H
#define RT_COMPRESSION_H
#include "runtime.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Returns the worst-case size of the compression result of a buffer with the given uncompressed
* size. */
RT_DLLEXPORT size_t rtGetCompressionBound(size_t uncompressed_size);
/* Compresses a buffer.
*
* Returns the number of bytes written to the output buffer, or 0 if compression failed
* due to insufficient capacity.
*/
RT_DLLEXPORT size_t rtCompressData(const void *in,
size_t uncompressed_size,
void *out,
size_t out_capacity);
/* Decompresses a buffer.
*
* Returns the number of bytes written to the output buffer, or 0 if decompression failed
* due to insufficient capacity.
*/
RT_DLLEXPORT size_t rtDecompressData(const void *in,
size_t compressed_size,
void *out,
size_t out_capacity);
#ifdef __cplusplus
}
#endif
#endif