aboutsummaryrefslogtreecommitdiff
path: root/core/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/render.c')
-rw-r--r--core/render.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/render.c b/core/render.c
index f9da65d..f42e821 100644
--- a/core/render.c
+++ b/core/render.c
@@ -8,8 +8,6 @@ SQLITE_EXTENSION_INIT1
#include "compress.c"
-#define EVA_SIZE (sizeof(uint64_t) * MVEC_SIZE)
-
void eva_render(sqlite3_context *context, int argc, sqlite3_value **argv) {
assert(context);
assert(argc == 4);
@@ -40,9 +38,16 @@ void eva_render(sqlite3_context *context, int argc, sqlite3_value **argv) {
size_t out_size = sizeof(uint64_t) * px_count;
uint64_t *eva = sqlite3_malloc(EVA_SIZE);
uint64_t *out = sqlite3_malloc(out_size);
- z_stream strm = { 0 };
- salis_inflate(&strm, blob_size, EVA_SIZE, (Bytef *)blob, (Bytef *)eva);
- salis_inflate_end(&strm);
+
+ struct InflateParams params = {
+ .avail_in = blob_size,
+ .size = EVA_SIZE,
+ .in = (Bytef *)blob,
+ .out = (Bytef *)eva,
+ };
+
+ salis_inflate(&params);
+ salis_inflate_end(&params);
// Render image
for (size_t i = 0; i < px_count; i++) {