From f531c3164271f69cb2caef0334b2e24fdd3f1efc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 5 Jan 2022 21:05:30 +0100 Subject: tracker/pt: clean up grayscale handling. add migration. The averaging mode is slower than the opencv SIMD implementation for BT.709. Remove it. Make it optional to perform hardware grayscaling using the ps3eye sensor with the open driver. Default to grayscaling using the CPU. --- migration/20220105_00-pt-grayscale.cpp | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 migration/20220105_00-pt-grayscale.cpp (limited to 'migration') diff --git a/migration/20220105_00-pt-grayscale.cpp b/migration/20220105_00-pt-grayscale.cpp new file mode 100644 index 00000000..44bdc470 --- /dev/null +++ b/migration/20220105_00-pt-grayscale.cpp @@ -0,0 +1,38 @@ +#include "migration.hpp" +#include "options/options.hpp" + +using namespace migrations; +using namespace options; + +#include "api/plugin-support.hpp" +#include "compat/library-path.hpp" + +struct pt_color_grayscale : migration +{ + bundle b { make_bundle("tracker-pt") }; + enum : int { pt_color_average = 5, pt_color_bt709 = 2, }; + + QString unique_date() const override + { + return "20220105_00"; + } + + QString name() const override + { + return "pt color enum"; + } + + bool should_run() const override + { + auto x = b->get_variant("blob-color").toInt(); + return x == pt_color_average; + } + + void run() override + { + b->store_kv("blob-color", QVariant::fromValue((int)pt_color_bt709)); + b->save(); + } +}; + +OPENTRACK_MIGRATION(pt_color_grayscale) -- cgit v1.2.3