File VolumeData.h

namespace OpenVDS

Enums

enum class VolumeDataFormat

Volume data format.

Values:

enumerator Format_Any

Volume data can be in any format.

enumerator Format_1Bit

Volume data is in packed 1-bit format.

enumerator Format_U8

Volume data is in unsigned 8 bit.

enumerator Format_U16

Volume data is in unsigned 16 bit.

enumerator Format_R32

Volume data is in 32 bit float.

enumerator Format_U32

Volume data is in unsigned 32 bit.

enumerator Format_R64

Volume data is in 64 bit double.

enumerator Format_U64

Volume data is in unsigned 64 bit.

enum class VolumeDataComponents

Volume data components.

Values:

enumerator Components_1

Volume data is scalar.

enumerator Components_2

Volume data has 2-components.

enumerator Components_4

Volume data has 4-components.

enum class InterpolationMethod

Interpolation method used for sampling.

Values:

enumerator Nearest

Snap to the closest sample.

enumerator Linear

Linear interpolation.

enumerator Cubic

Cubic interpolation.

enumerator Angular

Angular interpolation (same as linear but wraps around the value range)

enumerator Triangular

Triangular interpolation used to interpolate heightmap data.

enum DimensionsND

2D or 3D dimension group

Values:

enumerator Dimensions_012
enumerator Dimensions_013
enumerator Dimensions_014
enumerator Dimensions_015
enumerator Dimensions_023
enumerator Dimensions_024
enumerator Dimensions_025
enumerator Dimensions_034
enumerator Dimensions_035
enumerator Dimensions_045
enumerator Dimensions_123
enumerator Dimensions_124
enumerator Dimensions_125
enumerator Dimensions_134
enumerator Dimensions_135
enumerator Dimensions_145
enumerator Dimensions_234
enumerator Dimensions_235
enumerator Dimensions_245
enumerator Dimensions_345
enumerator Dimensions_01
enumerator Dimensions_02
enumerator Dimensions_03
enumerator Dimensions_04
enumerator Dimensions_05
enumerator Dimensions_12
enumerator Dimensions_13
enumerator Dimensions_14
enumerator Dimensions_15
enumerator Dimensions_23
enumerator Dimensions_24
enumerator Dimensions_25
enumerator Dimensions_34
enumerator Dimensions_35
enumerator Dimensions_45
enum class VolumeDataMapping

Mapping volume data channels.

Values:

enumerator Direct

Each voxel in the volume has a value.

enumerator PerTrace

Each line of voxels along dimension 0 in the volume has a number of values specifed by the MappedValueCount of the VolumeDataChannelDescriptor.

enum class CompressionMethod

Values:

enumerator None

No compression is applied; data is stored ‘as is’.

enumerator Wavelet

Voxel values are compressed using a lossy wavelet compression algorithm. This usually produces excellent results for continuous data, but is not applicable when dealing with discrete values.

enumerator RLE

Voxel values are compressed using run-length encoding which is a fast, lossless algorithm. This gives good results when the same value is often repeated for adjacent voxels, for example classification data.

enumerator Zip

Voxel values are compressed using zip (zlib) which is a slower, lossless algorithm that gives fairly good compression for all types of data.

enumerator WaveletNormalizeBlock

This method is experimental and no guarantee is made that decompression for data compressed in this format will be supported in future versions. Voxel values are compressed using a lossy wavelet compression algorithm. Also the threshold takes into account the absolute average of each block. This is good for data that varies a lot in signal strength. This usually produces excellent results for continuous data, but is not applicable when dealing with discrete values.

enumerator WaveletLossless

Voxel values are compressed using a losslees wavelet compression algorithm. This usually produces excellent results for continuous data, but is not applicable when dealing with discrete values.

enumerator WaveletNormalizeBlockLossless

This method is experimental and no guarantee is made that decompression for data compressed in this format will be supported in future versions. Voxel values are compressed using a lossless wavelet compression algorithm. Also the threshold takes into account the absolute average of each block. This is good for data that varies a lot in signal strength. This usually produces excellent results for continuous data, but is not applicable when dealing with discrete values.

Functions

inline constexpr int operator+(int n, VolumeDataComponents components)
inline constexpr int operator+(VolumeDataComponents components, int n)
inline int &operator+=(int &n, VolumeDataComponents components)
inline constexpr int operator-(int n, VolumeDataComponents components)
inline constexpr int operator-(VolumeDataComponents components, int n)
inline int &operator-=(int &n, VolumeDataComponents components)
inline constexpr int operator*(int n, VolumeDataComponents components)
inline constexpr int operator*(VolumeDataComponents components, int n)
inline int &operator*=(int &n, VolumeDataComponents components)
inline constexpr int operator/(int n, VolumeDataComponents components)
inline constexpr int operator/(VolumeDataComponents components, int n)
inline int &operator/=(int &n, VolumeDataComponents components)
inline constexpr bool operator==(int n, VolumeDataComponents components)
inline constexpr bool operator==(VolumeDataComponents components, int n)
inline constexpr bool operator!=(int n, VolumeDataComponents components)
inline constexpr bool operator!=(VolumeDataComponents components, int n)
inline constexpr bool operator<(int n, VolumeDataComponents components)
inline constexpr bool operator<(VolumeDataComponents components, int n)
inline constexpr bool operator<=(int n, VolumeDataComponents components)
inline constexpr bool operator<=(VolumeDataComponents components, int n)
inline constexpr bool operator>(int n, VolumeDataComponents components)
inline constexpr bool operator>(VolumeDataComponents components, int n)
inline constexpr bool operator>=(int n, VolumeDataComponents components)
inline constexpr bool operator>=(VolumeDataComponents components, int n)
inline bool CompressionMethod_IsWavelet(CompressionMethod compressionMethod)
inline int GetLODSize(int voxelMin, int voxelMax, int LOD, bool includePartialUpperVoxel = true)

Get the number of voxels at a particular LOD from a voxel range (ranges are exclusive).

Parameters:
  • voxelMin – The minimum voxel index of the range.

  • voxelMax – The maximum voxel index of the range (ranges are exclusive, so the range does not include voxelMax).

  • includePartialUpperVoxel – This controls the rounding. Usually you want the size of the range to be all voxels in the range, but when we are copying from multiple adjacent ranges we only want to round up for the last one.

  • LOD – The LOD level for which the size is requested.

Returns:

The number of voxels at the given LOD, at LOD 0 the result is voxelMax - voxelMin.

template<typename T>
inline T ReadElement(const T *buffer, size_t element)

Read element from buffer. This function has a template specialisation for bool making it suitable to read single bits from a buffer with packed bits.

Parameters:
  • buffer – Buffer to read from

  • element – The element index to read from buffer

Returns:

Element at position “element” is returned.

template<>
inline bool ReadElement<bool>(const bool *buffer, size_t element)
template<typename T>
inline void WriteElement(T *buffer, size_t element, T value)

Write element into buffer. This function has a template specialisation for bool making it suitable to write single bits into a buffer with packed bits.

Parameters:
  • buffer – Buffer to write to

  • element – The element index in the buffer to write to

  • value – Value to write

template<>
inline void WriteElement(bool *buffer, size_t element, bool value)
template<typename T>
inline int PitchScale()

Template function to get the scalar for the pitch value (which is in bytes for 1-bit data) used to scale the pitch to get the number of elements.

Returns:

The scale factor for the pitch for the given type

template<>
inline int PitchScale<bool>()
inline bool VolumeDataHash_IsDefined(uint64_t volumeDataHash)

Determine whether the given volume data hash is defined.

inline bool VolumeDataHash_IsNoValue(uint64_t volumeDataHash)

Determine whether the given volume data hash is the no-data-value.

inline bool VolumeDataHash_IsConstant(uint64_t volumeDataHash)

Determine whether the given volume data hash is constant.

Variables

constexpr int Dimensionality_Max = 6