Files
external_libcamera/include/libcamera/internal/ipa_proxy.h
Laurent Pinchart f934fd1cb9 libcamera: Move IPA headers from include/ipa/ to include/libcamera/ipa/
The IPA headers are installed into $prefix/include/libcamera/ipa/, but
are located in the source tree in include/ipa/. This requires files
within libcamera to include them with

 #include <ipa/foo.h>

while a third party IPA would need to use

 #include <libcamera/ipa/foo.h>

Not only is this inconsistent, it can create issues later if IPA headers
need to include each other, as the first form of include directive
wouldn't be valid once the headers are installed.

Fix the problem by moving the IPA headers to include/libcamera/ipa/.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-05-16 03:38:47 +03:00

71 lines
1.4 KiB
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2019, Google Inc.
*
* ipa_proxy.h - Image Processing Algorithm proxy
*/
#ifndef __LIBCAMERA_IPA_PROXY_H__
#define __LIBCAMERA_IPA_PROXY_H__
#include <memory>
#include <string>
#include <vector>
#include <libcamera/ipa/ipa_interface.h>
namespace libcamera {
class IPAModule;
class IPAProxy : public IPAInterface
{
public:
IPAProxy(IPAModule *ipam);
~IPAProxy();
bool isValid() const { return valid_; }
std::string configurationFile(const std::string &file) const;
protected:
std::string resolvePath(const std::string &file) const;
bool valid_;
private:
IPAModule *ipam_;
};
class IPAProxyFactory
{
public:
IPAProxyFactory(const char *name);
virtual ~IPAProxyFactory() {}
virtual std::unique_ptr<IPAProxy> create(IPAModule *ipam) = 0;
const std::string &name() const { return name_; }
static void registerType(IPAProxyFactory *factory);
static std::vector<IPAProxyFactory *> &factories();
private:
std::string name_;
};
#define REGISTER_IPA_PROXY(proxy) \
class proxy##Factory final : public IPAProxyFactory \
{ \
public: \
proxy##Factory() : IPAProxyFactory(#proxy) {} \
std::unique_ptr<IPAProxy> create(IPAModule *ipam) \
{ \
return std::make_unique<proxy>(ipam); \
} \
}; \
static proxy##Factory global_##proxy##Factory;
} /* namespace libcamera */
#endif /* __LIBCAMERA_IPA_PROXY_H__ */