Making mosaic images with ffmpeg
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
862 B

#pragma once
#include <av/av.hpp>
#include <utility>
// 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 <typename Fingerprint>
struct fingerprint_traits {
using fingerprint = Fingerprint;
using pre_fingerprint = decltype(fingerprint::pre_calculate(std::declval<av::frame>()));
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<fingerprint const &>(), std::declval<pre_fingerprint const &>()));
};