ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvNormalCompressor.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "CV_db.h"
11 
12 // Local
13 #include "ecvBasicTypes.h"
14 
17 public:
19 
21  static const unsigned char QUANTIZE_LEVEL =
22  9; // 2097152 normals * 12 bytes = 24 Mb of memory
23 
25  static const unsigned MAX_VALID_NORM_CODE =
26  (1 << (QUANTIZE_LEVEL * 2 + 3)) - 1;
28  static const unsigned NULL_NORM_CODE = MAX_VALID_NORM_CODE + 1;
29 
31  static unsigned Compress(const PointCoordinateType N[3]);
32 
34  static void Decompress(unsigned index,
36  unsigned char level = QUANTIZE_LEVEL);
37 
39  static void InvertNormal(CompressedNormType &code);
40 };
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
#define CV_DB_LIB_API
Definition: CV_db.h:15
Normal compressor.
static void InvertNormal(CompressedNormType &code)
Inverts a (compressed) normal.
static unsigned Compress(const PointCoordinateType N[3])
Compression algorithm.
static void Decompress(unsigned index, PointCoordinateType N[3], unsigned char level=QUANTIZE_LEVEL)
Decompression algorithm.
unsigned int CompressedNormType
Compressed normals type.
Definition: ecvBasicTypes.h:16