qCC_db version 2.13.alpha (Qt) - 31 May 2022
CloudCompare 3D entities
Static Public Member Functions | Static Public Attributes | List of all members
ccNormalCompressor Class Reference

Normal compressor. More...

#include <ccNormalCompressor.h>

Static Public Member Functions

static unsigned Compress (const PointCoordinateType N[3])
 Compression algorithm. More...
 
static void Decompress (unsigned index, PointCoordinateType N[3], unsigned char level=QUANTIZE_LEVEL)
 Decompression algorithm. More...
 
static void InvertNormal (CompressedNormType &code)
 Inverts a (compressed) normal.
 

Static Public Attributes

static const unsigned char QUANTIZE_LEVEL = 9
 Compressed normals quantization level (number of directions: 2^(2*N+3)) More...
 
static const unsigned MAX_VALID_NORM_CODE = (1 << (QUANTIZE_LEVEL * 2 + 3)) - 1
 Last valid normal code.
 
static const unsigned NULL_NORM_CODE = MAX_VALID_NORM_CODE + 1
 Null normal code.
 

Detailed Description

Normal compressor.

Member Function Documentation

◆ Compress()

unsigned ccNormalCompressor::Compress ( const PointCoordinateType  N[3])
static

Compression algorithm.

compute in which sector lie the elements

scale the sectored vector - early return for null vector

compute the box

then for each required level, quantize...

◆ Decompress()

void ccNormalCompressor::Decompress ( unsigned  index,
PointCoordinateType  N[3],
unsigned char  level = QUANTIZE_LEVEL 
)
static

Decompression algorithm.

special case for the null code

recompute the box in the sector...

Member Data Documentation

◆ QUANTIZE_LEVEL

const unsigned char ccNormalCompressor::QUANTIZE_LEVEL = 9
static

Compressed normals quantization level (number of directions: 2^(2*N+3))

Warning
Never pass a 'constant initializer' by reference

The documentation for this class was generated from the following files: