Skip to main content

Crate zfp_rs_ffi

Crate zfp_rs_ffi 

Source
Expand description

§zfp-rs-ffi

C ABI bindings layer around the pure-Rust zfp-rs implementation.

This crate mirrors the API surface of zfp-sys (generated from #include <zfp.h>), providing zero-cost FFI adapters that delegate to the existing zfp-rs compression logic.

All ABI functions export upstream-compatible zfp_* and stream_* symbol names, so C consumers can include the generated zfp.h and link this crate’s static library in place of the upstream C library.

§Scope

The target API is zfp-sys version 0.1.15 as generated in this workspace. This includes stream_* functions except stream_set_stride (not enabled in zfp-sys), and excludes CFP APIs and zfp_block_maximum_size.

Structs§

zfp_config
C zfp_config
zfp_config__bindgen_ty_1__bindgen_ty_1
Expert-mode payload inside zfp_config__bindgen_ty_1.
zfp_exec_params_omp
C zfp_exec_params_omp
zfp_execution
C zfp_execution
zfp_field
C zfp_field: field descriptor for compression/decompression. cbindgen:field-names=[type, nx, ny, nz, nw, sx, sy, sz, sw, data]
zfp_stream
C zfp_stream

Enums§

zfp_exec_policy
C zfp_exec_policy values
zfp_mode
C zfp_mode values
zfp_type
C zfp_type values

Constants§

ZFP_CODEC_VERSION
ZFP codec version (5).
ZFP_DATA_ALL
All data positions (ZFP_DATA_ALL).
ZFP_DATA_CACHE
Cache data position (ZFP_DATA_CACHE).
ZFP_DATA_HEADER
Header data position (ZFP_DATA_HEADER).
ZFP_DATA_INDEX
Index data position (ZFP_DATA_INDEX).
ZFP_DATA_META
Metadata data position (ZFP_DATA_META).
ZFP_DATA_MISC
Miscellaneous data position (ZFP_DATA_MISC).
ZFP_DATA_PADDING
Padding data position (ZFP_DATA_PADDING).
ZFP_DATA_PAYLOAD
Compressed payload data position (ZFP_DATA_PAYLOAD).
ZFP_DATA_UNUSED
Unused data position (ZFP_DATA_UNUSED).
ZFP_HEADER_FULL
All header sections (ZFP_HEADER_FULL).
ZFP_HEADER_MAGIC
32-bit magic word (ZFP_HEADER_MAGIC).
ZFP_HEADER_MAX_BITS
Maximum header size in bits (ZFP_HEADER_MAX_BITS).
ZFP_HEADER_META
52-bit field metadata (ZFP_HEADER_META).
ZFP_HEADER_MODE
12- or 64-bit compression mode (ZFP_HEADER_MODE).
ZFP_HEADER_NONE
No header sections (ZFP_HEADER_NONE).
ZFP_LIBRARY_MAJOR
ZFP library version components (major=1, minor=0, patch=1, tweak=0).
ZFP_LIBRARY_MINOR
ZFP_LIBRARY_PATCH
ZFP_LIBRARY_TWEAK
ZFP_MAGIC_BITS
Number of bits in the magic word (ZFP_MAGIC_BITS).
ZFP_MAX_BITS
Maximum number of bits per block (ZFP_MAX_BITS).
ZFP_MAX_PREC
Maximum precision in bits (ZFP_MAX_PREC).
ZFP_META_BITS
Number of bits in the metadata word (ZFP_META_BITS).
ZFP_META_NULL
Null metadata value (u64::MAX).
ZFP_MIN_BITS
Minimum number of bits per block (ZFP_MIN_BITS).
ZFP_MIN_EXP
Minimum exponent (ZFP_MIN_EXP).
ZFP_MODE_LONG_BITS
Number of bits in the long mode word (ZFP_MODE_LONG_BITS).
ZFP_MODE_SHORT_BITS
Number of bits in the short mode word (ZFP_MODE_SHORT_BITS).
ZFP_MODE_SHORT_MAX
Maximum value representable in a 12-bit mode word (ZFP_MODE_SHORT_MAX).
ZFP_ROUND_FIRST
Round towards zero for the first conversion (ZFP_ROUND_FIRST).
ZFP_ROUND_LAST
Round towards zero for the last conversion (ZFP_ROUND_LAST).
ZFP_ROUND_NEVER
Never round (ZFP_ROUND_NEVER).
ZFP_VERSION_STRING
Version string.
zfp_exec_policy_zfp_exec_cuda
zfp_exec_policy_zfp_exec_omp
zfp_exec_policy_zfp_exec_serial
zfp_false
C zfp_false
zfp_mode_zfp_mode_expert
zfp_mode_zfp_mode_fixed_accuracy
zfp_mode_zfp_mode_fixed_precision
zfp_mode_zfp_mode_fixed_rate
zfp_mode_zfp_mode_null
zfp_mode_zfp_mode_reversible
zfp_true
C zfp_true
zfp_type_zfp_type_double
zfp_type_zfp_type_float
zfp_type_zfp_type_int32
zfp_type_zfp_type_int64
zfp_type_zfp_type_none

Statics§

ZFP_VERSION_STRING_BYTES
C zfp_version_string symbol.
stream_word_bits
C stream_word_bits symbol.
zfp_codec_version
C zfp_codec_version symbol.
zfp_library_version
C zfp_library_version symbol (encoded as major10000 + minor100 + patch).

Functions§

stream_align
Discard buffered read bits and align to the next word boundary. Returns the number of bits discarded.
stream_alignment
Return the required alignment for bitstream operations.
stream_capacity
Return the total byte capacity of the bitstream.
stream_clone
Clone a bitstream by copying all committed bytes.
stream_close
Close and free a bitstream.
stream_copy
Copy n bits from src into dst.
stream_data
Return a pointer to the bitstream’s data buffer.
stream_flush
Flush the write buffer to the next word boundary. Returns the number of padding bits written.
stream_open
Open a new bitstream with the given byte capacity.
stream_pad
Append n zero-bits to the write stream.
stream_read_bit
Read a single bit from the bitstream.
stream_read_bits
Read n bits from the bitstream.
stream_rewind
Rewind the bitstream to the beginning.
stream_rseek
Position the read cursor at offset bits.
stream_rtell
Return the current read bit offset.
stream_size
Return the committed byte size of the bitstream.
stream_skip
Skip n bits forward in the read cursor.
stream_stride_block
Return the stride block size in bytes (always 8 for 64-bit words).
stream_stride_delta
Return the stride delta between blocks (always -8).
stream_write_bit
Write a single bit to the bitstream.
stream_write_bits
Write the low n bits of value to the bitstream. Returns the overflow (bits above n).
stream_wseek
Position the write cursor at offset bits.
stream_wtell
Return the current write bit offset.
zfp_compress
zfp_config_accuracy
Create a zfp_config for fixed-accuracy mode.
zfp_config_expert
Create a zfp_config for expert mode.
zfp_config_none
Create a zfp_config with null mode.
zfp_config_precision
Create a zfp_config for fixed-precision mode.
zfp_config_rate
Create a zfp_config for fixed-rate mode.
zfp_config_reversible
Create a zfp_config for reversible (lossless) mode.
zfp_decode_block_double_1
zfp_decode_block_double_2
zfp_decode_block_double_3
zfp_decode_block_double_4
zfp_decode_block_float_1
zfp_decode_block_float_2
zfp_decode_block_float_3
zfp_decode_block_float_4
zfp_decode_block_int32_1
zfp_decode_block_int32_2
zfp_decode_block_int32_3
zfp_decode_block_int32_4
zfp_decode_block_int64_1
zfp_decode_block_int64_2
zfp_decode_block_int64_3
zfp_decode_block_int64_4
zfp_decode_block_strided_double_1
zfp_decode_block_strided_double_2
zfp_decode_block_strided_double_3
zfp_decode_block_strided_double_4
zfp_decode_block_strided_float_1
zfp_decode_block_strided_float_2
zfp_decode_block_strided_float_3
zfp_decode_block_strided_float_4
zfp_decode_block_strided_int32_1
zfp_decode_block_strided_int32_2
zfp_decode_block_strided_int32_3
zfp_decode_block_strided_int32_4
zfp_decode_block_strided_int64_1
zfp_decode_block_strided_int64_2
zfp_decode_block_strided_int64_3
zfp_decode_block_strided_int64_4
zfp_decode_partial_block_strided_double_1
zfp_decode_partial_block_strided_double_2
zfp_decode_partial_block_strided_double_3
zfp_decode_partial_block_strided_double_4
zfp_decode_partial_block_strided_float_1
zfp_decode_partial_block_strided_float_2
zfp_decode_partial_block_strided_float_3
zfp_decode_partial_block_strided_float_4
zfp_decode_partial_block_strided_int32_1
zfp_decode_partial_block_strided_int32_2
zfp_decode_partial_block_strided_int32_3
zfp_decode_partial_block_strided_int32_4
zfp_decode_partial_block_strided_int64_1
zfp_decode_partial_block_strided_int64_2
zfp_decode_partial_block_strided_int64_3
zfp_decode_partial_block_strided_int64_4
zfp_decompress
zfp_demote_int32_to_int8
zfp_demote_int32_to_int16
zfp_demote_int32_to_uint8
zfp_demote_int32_to_uint16
zfp_encode_block_double_1
zfp_encode_block_double_2
zfp_encode_block_double_3
zfp_encode_block_double_4
zfp_encode_block_float_1
zfp_encode_block_float_2
zfp_encode_block_float_3
zfp_encode_block_float_4
zfp_encode_block_int32_1
zfp_encode_block_int32_2
zfp_encode_block_int32_3
zfp_encode_block_int32_4
zfp_encode_block_int64_1
zfp_encode_block_int64_2
zfp_encode_block_int64_3
zfp_encode_block_int64_4
zfp_encode_block_strided_double_1
zfp_encode_block_strided_double_2
zfp_encode_block_strided_double_3
zfp_encode_block_strided_double_4
zfp_encode_block_strided_float_1
zfp_encode_block_strided_float_2
zfp_encode_block_strided_float_3
zfp_encode_block_strided_float_4
zfp_encode_block_strided_int32_1
zfp_encode_block_strided_int32_2
zfp_encode_block_strided_int32_3
zfp_encode_block_strided_int32_4
zfp_encode_block_strided_int64_1
zfp_encode_block_strided_int64_2
zfp_encode_block_strided_int64_3
zfp_encode_block_strided_int64_4
zfp_encode_partial_block_strided_double_1
zfp_encode_partial_block_strided_double_2
zfp_encode_partial_block_strided_double_3
zfp_encode_partial_block_strided_double_4
zfp_encode_partial_block_strided_float_1
zfp_encode_partial_block_strided_float_2
zfp_encode_partial_block_strided_float_3
zfp_encode_partial_block_strided_float_4
zfp_encode_partial_block_strided_int32_1
zfp_encode_partial_block_strided_int32_2
zfp_encode_partial_block_strided_int32_3
zfp_encode_partial_block_strided_int32_4
zfp_encode_partial_block_strided_int64_1
zfp_encode_partial_block_strided_int64_2
zfp_encode_partial_block_strided_int64_3
zfp_encode_partial_block_strided_int64_4
zfp_field_1d
zfp_field_2d
zfp_field_3d
zfp_field_4d
zfp_field_alloc
zfp_field_begin
zfp_field_blocks
zfp_field_dimensionality
zfp_field_free
zfp_field_is_contiguous
zfp_field_metadata
zfp_field_pointer
zfp_field_precision
zfp_field_set_metadata
zfp_field_set_pointer
zfp_field_set_size_1d
zfp_field_set_size_2d
zfp_field_set_size_3d
zfp_field_set_size_4d
zfp_field_set_stride_1d
zfp_field_set_stride_2d
zfp_field_set_stride_3d
zfp_field_set_stride_4d
zfp_field_set_type
zfp_field_size
zfp_field_size_bytes
zfp_field_stride
zfp_field_type
zfp_promote_int8_to_int32
zfp_promote_int16_to_int32
zfp_promote_uint8_to_int32
zfp_promote_uint16_to_int32
zfp_read_header
zfp_stream_accuracy
zfp_stream_align
zfp_stream_bit_stream
zfp_stream_close
zfp_stream_compressed_size
zfp_stream_compression_mode
zfp_stream_execution
zfp_stream_flush
zfp_stream_maximum_size
zfp_stream_mode
zfp_stream_omp_chunk_size
zfp_stream_omp_threads
zfp_stream_open
zfp_stream_params
zfp_stream_precision
zfp_stream_rate
zfp_stream_rewind
zfp_stream_set_accuracy
zfp_stream_set_bit_stream
zfp_stream_set_execution
zfp_stream_set_mode
zfp_stream_set_omp_chunk_size
zfp_stream_set_omp_threads
zfp_stream_set_params
zfp_stream_set_precision
zfp_stream_set_rate
zfp_stream_set_reversible
zfp_type_size
zfp_write_header

Type Aliases§

bitstream
Opaque C bitstream pointer type (opaque to Rust).
bitstream_count
C bitstream_count type
bitstream_offset
C bitstream_offset type
bitstream_size
C bitstream_size type
int8
C signed char
int16
C signed short
int32
C signed int
int64
C long long
uint
C unsigned int
uint8
C unsigned char
uint16
C unsigned short
uint64
C unsigned long long
zfp_bool
C int used as boolean

Unions§

zfp_config__bindgen_ty_1
Payload of the zfp_config union: mirrors the C zfp_config__bindgen_ty_1.