#pragma once #include #include // A fingerprint is used to speed up comparison. However, this is done assymetrically. Only the // compressed version is used in the database, but for comparison the full image can be used. template struct fingerprint_traits { using fingerprint = Fingerprint; using pre_fingerprint = decltype(fingerprint::pre_calculate(std::declval())); static pre_fingerprint pre_calculate(av::frame const & frame) { return fingerprint::pre_calculate(frame); } static fingerprint calculate(av::frame const & frame) { return fingerprint::calculate(frame); } static auto distance(fingerprint const & x, pre_fingerprint const & y) { return x.distance_to(y); } using distance_type = decltype(distance(std::declval(), std::declval())); };