Skip to main content

forward_scaleoffset

Function forward_scaleoffset 

Source
pub fn forward_scaleoffset(
    data: &[u8],
    cd_values: &[u32],
) -> FormatResult<Vec<u8>>
Expand description

Apply the HDF5 scale-offset filter (compress).

data is the raw element buffer in the dataset datatype’s byte order and the result is the stored chunk: a 21-byte parameter header holding the chosen minimum bit count and the chunk minimum, followed by the packed values. Both the header and the compressed length mirror H5Z__filter_scaleoffset’s forward branch, including its allocation of one byte more than the packed bits need.