Loading...
Searching...
No Matches
GridChecksum.h File Reference

Computes a pair of 32bit checksums, of a Grid, by means of Cyclic Redundancy Check (CRC) More...

`#include <algorithm>`
`#include <array>`
`#include <vector>`
`#include <cstdint>`
`#include <cstddef>`
`#include <numeric>`
`#include <type_traits>`
`#include <memory>`
`#include <nanovdb/NanoVDB.h>`
`#include "ForEach.h"`
`#include "NodeManager.h"`

Go to the source code of this file.

## Classes

class | GridChecksum
| Class that encapsulates two CRC32 checksums, one for the Grid, Tree and Root node meta data and one for the remaining grid nodes. More...

## Namespaces

namespace | nanovdb
| Convert a base-pointer to an openvdb grid, denoted srcGrid, to a nanovdb grid of the same type, e.g. float -> float or openvdb::Vec3f -> nanovdb::Vec3f.
namespace | nanovdb::crc32

## Macros

#define | NANOVDB_CRC32_LOG2_BLOCK_SIZE 12

## Enumerations

enum class | ChecksumMode : uint32_t { Disable = 0 , Partial = 1 , Full = 2 , Default = 1 , End = 3 }
| List of different modes for computing for a checksum. More...

## Functions

template<typename BuildT >
uint64_t | checksum (const NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
| Return the (2 x CRC32) checksum of the specified grid.
template<typename BuildT >
bool | validateChecksum (const NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
| Return true if the checksum of the grid matches the expected value already encoded into the grid's meta data.
template<typename BuildT >
void | updateChecksum (NanoGrid< BuildT > &grid, ChecksumMode mode=ChecksumMode::Default)
| Updates the checksum of a grid.
__hostdev__ void | initLut (uint32_t lut[256], uint32_t n)
| Initiate single entry in look-up-table for CRC32 computations.
__hostdev__ void | initLut (uint32_t lut[256])
| Initiate entire look-up-table for CRC32 computations.
std::unique_ptr< uint32_t[]> | createLut ()
| Create and initiate entire look-up-table for CRC32 computations.
__hostdev__ uint32_t | checksum (const void *data, size_t size, uint32_t crc=0)
| Compute crc32 checksum of `data` of `size` bytes (without a lookup table))
__hostdev__ uint32_t | checksum (const void *begin, const void *end, uint32_t crc=0)
| Compute crc32 checksum of data between `begin` and `end`.
__hostdev__ uint32_t | checksum (const void *data, size_t size, const uint32_t lut[256], uint32_t crc=0)
| Compute crc32 checksum of `data` with `size` bytes using a lookup table.
__hostdev__ uint32_t | checksum (const void *begin, const void *end, const uint32_t lut[256], uint32_t crc=0)
| Compute crc32 checksum of data between `begin` and `end` using a lookup table.
template<typename ValueT >
uint64_t | checksum (const NanoGrid< ValueT > &grid, ChecksumMode mode)
template<typename ValueT >
bool | validateChecksum (const NanoGrid< ValueT > &grid, ChecksumMode mode)
template<typename ValueT >
void | updateChecksum (NanoGrid< ValueT > &grid, ChecksumMode mode)
bool | updateChecksum (GridData &gridData, ChecksumMode mode)
bool | updateChecksum (GridData *data)
| Preserve the existing mode of the checksum and update it if it's not disabled.
bool | updateGridCount (GridData *data, uint32_t gridIndex, uint32_t gridCount)
| Updates the ground index and count, as well as the partial checksum if needed.

## Detailed Description

Computes a pair of 32bit checksums, of a Grid, by means of Cyclic Redundancy Check (CRC)

Author
  Ken Museth

A CRC32 is the 32 bit remainder, or residue, of binary division of a message, by a polynomial.

## Macro Definition Documentation

## NANOVDB_CRC32_LOG2_BLOCK_SIZE

#define NANOVDB_CRC32_LOG2_BLOCK_SIZE 12