ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccNormalCompressor Class Reference

Normal compressor. More...

#include <ecvNormalCompressor.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. More...
 

Static Public Attributes

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

Detailed Description

Normal compressor.

Definition at line 16 of file ecvNormalCompressor.h.

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...

Definition at line 23 of file ecvNormalCompressor.cpp.

References NULL_NORM_CODE, QUANTIZE_LEVEL, x, y, and z.

Referenced by ccNormalVectors::GetNormIndex().

◆ 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...

Definition at line 119 of file ecvNormalCompressor.cpp.

References NULL_NORM_CODE.

Referenced by ccNormalVectors::init().

◆ InvertNormal()

void ccNormalCompressor::InvertNormal ( CompressedNormType code)
static

Inverts a (compressed) normal.

Definition at line 16 of file ecvNormalCompressor.cpp.

References NULL_NORM_CODE, and QUANTIZE_LEVEL.

Referenced by ccPointCloud::invertNormals(), and ccMesh::invertPerTriangleNormals().

Member Data Documentation

◆ MAX_VALID_NORM_CODE

const unsigned ccNormalCompressor::MAX_VALID_NORM_CODE
static
Initial value:
=
(1 << (QUANTIZE_LEVEL * 2 + 3)) - 1
static const unsigned char QUANTIZE_LEVEL
Compressed normals quantization level (number of directions: 2^(2*N+3))

Last valid normal code.

Definition at line 25 of file ecvNormalCompressor.h.

◆ NULL_NORM_CODE

const unsigned ccNormalCompressor::NULL_NORM_CODE = MAX_VALID_NORM_CODE + 1
static

Null normal code.

Definition at line 28 of file ecvNormalCompressor.h.

Referenced by Compress(), Decompress(), ccNormalVectors::init(), and InvertNormal().

◆ QUANTIZE_LEVEL

const unsigned char ccNormalCompressor::QUANTIZE_LEVEL
static
Initial value:
=
9

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

Warning
Never pass a 'constant initializer' by reference

Definition at line 21 of file ecvNormalCompressor.h.

Referenced by Compress(), and InvertNormal().


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