libipa defines an abstract Algorithm class template that is specialized by IPA modules. IPA modules then instantiate and manage algorithms internally, without help from libipa. With ongoing work on tuning data support for the RkISP1, and future similar work for the IPU3, more code duplication for algorithms management is expected. To address this and share code between multiple IPA modules, introduce a new Module class template that will define and manage top-level concepts for the IPA module. The Module class template needs to be specialized with the same types as the Algorithm class. To avoid manual specialization of both classes, store the types in the Module class, and replace the template arguments of the Algorithm class with a single Module argument from which the other types are retrieved. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
40 lines
847 B
C++
40 lines
847 B
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2021, Ideas On Board
|
|
*
|
|
* algorithm.h - ISP control algorithm interface
|
|
*/
|
|
#pragma once
|
|
|
|
namespace libcamera {
|
|
|
|
namespace ipa {
|
|
|
|
template<typename Module>
|
|
class Algorithm
|
|
{
|
|
public:
|
|
virtual ~Algorithm() {}
|
|
|
|
virtual int configure([[maybe_unused]] typename Module::Context &context,
|
|
[[maybe_unused]] const typename Module::Config &configInfo)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
virtual void prepare([[maybe_unused]] typename Module::Context &context,
|
|
[[maybe_unused]] typename Module::Params *params)
|
|
{
|
|
}
|
|
|
|
virtual void process([[maybe_unused]] typename Module::Context &context,
|
|
[[maybe_unused]] typename Module::FrameContext *frameContext,
|
|
[[maybe_unused]] const typename Module::Stats *stats)
|
|
{
|
|
}
|
|
};
|
|
|
|
} /* namespace ipa */
|
|
|
|
} /* namespace libcamera */
|