Function om_decoder_next_data_read

Source
pub unsafe extern "C" fn om_decoder_next_data_read(
    decoder: *const OmDecoder_t,
    dataRead: *mut OmDecoder_dataRead_t,
    indexData: *const c_void,
    indexDataCount: u64,
    error: *mut OmError_t,
) -> bool
Expand description

@brief Prepares the next data read operation for a given chunk of compressed data.

This function advances the data reading process by calculating the start and end positions of the next data segment to read based on the provided index data and current state of the om_decoder_data_read_t structure. It determines how much data to read from the compressed data source and where the decompressed data should be written.

The function supports two formats:

  1. Version 1 format (non-compressed LUTs, where lut_chunk_element_count is 1).
  2. Compressed LUT format (Version 3+).

The function reads from a specified index data and updates the data_read structure with the offset and size of the next data block to be read.

@param[in] decoder A pointer to the om_decoder_t structure, which contains information about the file format, compression settings, and LUT (look-up table) characteristics. @param[out] data_read A pointer to om_decoder_data_read_t structure that holds the state of the current data read operation. This structure is updated to reflect the next segment of data to read. @param[in] index_data A pointer to the index data, which provides the compressed offset information for each chunk in the LUT. @param[in] index_data_size The size of the index_data buffer in bytes.

@returns true if the next data segment was successfully prepared and ready for reading, false if there are no more data segments to read or if the range is exhausted.

@returns May return an out-of-bounds read error on corrupted data.