Krita Source Code Documentation
Loading...
Searching...
No Matches
map_traits.h File Reference
#include <QtCore>

Go to the source code of this file.

Classes

struct  DefaultKeyTraits< T >
 
struct  DefaultValueTraits< T >
 

Functions

quint32 avalanche (quint32 h)
 
quint32 deavalanche (quint32 h)
 
bool isPowerOf2 (quint64 v)
 
quint64 roundUpPowerOf2 (quint64 v)
 

Function Documentation

◆ avalanche()

quint32 avalanche ( quint32 h)
inline

Definition at line 34 of file map_traits.h.

35{
36 h ^= h >> 16;
37 h *= 0x85ebca6b;
38 h ^= h >> 13;
39 h *= 0xc2b2ae35;
40 h ^= h >> 16;
41 return h;
42}

◆ deavalanche()

quint32 deavalanche ( quint32 h)
inline

Definition at line 44 of file map_traits.h.

45{
46 h ^= h >> 16;
47 h *= 0x7ed1b41d;
48 h ^= (h ^ (h >> 13)) >> 13;
49 h *= 0xa5cb9243;
50 h ^= h >> 16;
51 return h;
52}

◆ isPowerOf2()

bool isPowerOf2 ( quint64 v)
inline

Definition at line 29 of file map_traits.h.

30{
31 return (v & (v - 1)) == 0;
32}
qreal v

References v.

◆ roundUpPowerOf2()

quint64 roundUpPowerOf2 ( quint64 v)
inline

Definition at line 16 of file map_traits.h.

17{
18 v--;
19 v |= v >> 1;
20 v |= v >> 2;
21 v |= v >> 4;
22 v |= v >> 8;
23 v |= v >> 16;
24 v |= v >> 32;
25 v++;
26 return v;
27}

References v.