Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DeflatePro
#1
This is a QB64 _INFLATE$ compatible compression library. Internally it uses Google's Zopfli. Zopfli is a highly optimized C-based compression library designed to produce efficient (though slow) Deflate or zlib-compressed data. The advantage is that the compressed data is fully compatible with QB64’s _INFLATE$ function, allowing seamless decompression.

The library contains a single function:

Code: (Select All)
' @brief Compresses a STRING buffer using the Deflate algorithm with Zopfli. The output can be decompressed using QB64's _INFLATE$ function.
' @param inputBuffer The STRING buffer to compress.
' @param compressionLevel The compression level to use (0 - 65535). 65535 provides the highest compression, while 0 uses the library’s default. Levels above 255 may yield diminishing returns and are extremely slow.
' @return The compressed string.
FUNCTION DeflatePro$ (inputBuffer AS STRING, compressionLevel AS _UNSIGNED INTEGER)

The attached file has a test program in the zip root and the library inside the "include" directory. Use it however you see fit.

[Image: Screenshot-2024-12-20-223703.png]


FAQ:
Q: Why did you do this?
A: Why not? Ok, just for fun.


Attached Files
.zip   DeflatePro.zip (Size: 31.61 KB / Downloads: 10)
Reply


Messages In This Thread
DeflatePro - by a740g - 9 hours ago
RE: DeflatePro - by Petr - 7 hours ago
RE: DeflatePro - by a740g - 1 hour ago



Users browsing this thread: 2 Guest(s)