MayaFlux 0.4.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 7 of file RegionCacheManager.cpp.

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

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