DGtal 1.3.0
|
Aim: Implements the binary Morton code construction in nD. More...
#include <DGtal/images/Morton.h>
Public Types | |
typedef THashKey | HashKey |
typedef TPoint | Point |
typedef Point::Coordinate | Coordinate |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CUnsignedNumber< THashKey >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CIntegralNumber< THashKey >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CInteger< Coordinate >)) | |
BOOST_STATIC_CONSTANT (Dimension, dimension=TPoint::dimension) | |
Morton () | |
void | interleaveBits (const Point &aPoint, HashKey &output) const |
HashKey | keyFromCoordinates (const std::size_t treeDepth, const Point &coordinates) const |
void | coordinatesFromKey (const HashKey key, Point &coordinates) const |
HashKey | parentKey (const HashKey key) const |
void | brotherKeys (const HashKey key, HashKey *result) const |
void | childrenKeys (const HashKey key, HashKey *result) const |
Aim: Implements the binary Morton code construction in nD.
Description of template class 'Morton'
Given a point in nD \((x_1,\ldots, x_n)\), a Morton code consists in interleaving bits of \(x_i\) coordinate values (plus a prefix for the HashTree construction.
Main methods in this class are keyFromCoordinates to generate a key and CoordinatesFromKey to generate a point from a code.
THashKey | type to store the morton code (should have enough capacity to store the interleaved binary word). |
TPoint | type of points. |
typedef Point::Coordinate DGtal::Morton< THashKey, TPoint >::Coordinate |
typedef THashKey DGtal::Morton< THashKey, TPoint >::HashKey |
typedef TPoint DGtal::Morton< THashKey, TPoint >::Point |
DGtal::Morton< THashKey, TPoint >::Morton | ( | ) |
Constructor
DGtal::Morton< THashKey, TPoint >::BOOST_CONCEPT_ASSERT | ( | (concepts::CInteger< Coordinate >) | ) |
DGtal::Morton< THashKey, TPoint >::BOOST_CONCEPT_ASSERT | ( | (concepts::CIntegralNumber< THashKey >) | ) |
DGtal::Morton< THashKey, TPoint >::BOOST_CONCEPT_ASSERT | ( | (concepts::CUnsignedNumber< THashKey >) | ) |
DGtal::Morton< THashKey, TPoint >::BOOST_STATIC_CONSTANT | ( | Dimension | , |
dimension | = TPoint::dimension |
||
) |
void DGtal::Morton< THashKey, TPoint >::brotherKeys | ( | const HashKey | key, |
HashKey * | result | ||
) | const |
Computes the brother keys (ie the keys having the same parent) of the key passed in parameter.
key | The key. |
result | Will contain the resulting brother keys. |
void DGtal::Morton< THashKey, TPoint >::childrenKeys | ( | const HashKey | key, |
HashKey * | result | ||
) | const |
Computes the children keys of the key passed in parameter.
key | The key. |
result | Will contain the resulting children keys. |
Referenced by testMorton().
void DGtal::Morton< THashKey, TPoint >::coordinatesFromKey | ( | const HashKey | key, |
Point & | coordinates | ||
) | const |
Computes the coordinates correspponding to a key.
key | The key. |
coordinates | Will contain the resulting coordinates. |
Referenced by testMorton().
void DGtal::Morton< THashKey, TPoint >::interleaveBits | ( | const Point & | aPoint, |
HashKey & | output | ||
) | const |
Interleave the bits of the nbIn inputs.
aPoint | an array of the nbIn values to mix in. |
output | The result |
Referenced by testMorton().
HashKey DGtal::Morton< THashKey, TPoint >::keyFromCoordinates | ( | const std::size_t | treeDepth, |
const Point & | coordinates | ||
) | const |
Returns the key corresponding to the coordinates passed in the parameters.
treeDepth | The depth at which the coordinates are to be read (usualy corresponds to the deepest leave). |
coordinates | An array containing the coordinates to convert into a key. |
Referenced by testMorton().
|
inline |