MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ operator()()

std::size_t MayaFlux::Kakshya::RegionHash::operator() ( const Region region) const

Definition at line 5 of file RegionCacheManager.cpp.

6{
7 std::size_t h1 = 0;
8 std::size_t h2 = 0;
9
10 for (const auto& coord : region.start_coordinates) {
11 h1 ^= std::hash<uint64_t> {}(coord) + 0x9e3779b9 + (h1 << 6) + (h1 >> 2);
12 }
13
14 for (const auto& coord : region.end_coordinates) {
15 h2 ^= std::hash<uint64_t> {}(coord) + 0x9e3779b9 + (h2 << 6) + (h2 >> 2);
16 }
17
18 return h1 ^ (h2 << 1);
19}

References MayaFlux::Kakshya::Region::end_coordinates, and MayaFlux::Kakshya::Region::start_coordinates.