fortplot_zlib_core Module

Pure Fortran implementation of zlib compression, decompression, and CRC32 Ported from STB image libraries for self-contained PNG support



Functions

public function crc32_calculate(data, data_len) result(crc)

Calculate CRC32 checksum using standard polynomial

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: data(*)
integer, intent(in) :: data_len

Return Value integer(kind=int32)

public function zlib_compress(input_data, input_len, output_len) result(output_data)

Backwards-compatible wrapper returning an allocatable result

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: input_data(*)
integer, intent(in) :: input_len
integer, intent(out) :: output_len

Return Value integer(kind=int8), allocatable, (:)

public function zlib_decompress(input_data, input_len, status, verify_checksum) result(output_data)

Decompress zlib (deflate) data using fixed Huffman tables

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: input_data(*)
integer, intent(in) :: input_len
integer, intent(out), optional :: status
logical, intent(in), optional :: verify_checksum

Return Value integer(kind=int8), allocatable, (:)


Subroutines

public subroutine initialize_zlib_debug()

Initialize debug logging based on FORTPLOT_ZLIB_DEBUG environment variable

Arguments

None

public subroutine zlib_compress_into(input_data, input_len, output_data, output_len)

Compress data into a newly allocated buffer

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: input_data(*)
integer, intent(in) :: input_len
integer(kind=int8), intent(out), allocatable :: output_data(:)
integer, intent(out) :: output_len