[libcamera-devel,RFC,v2,1/3] WIP: ipa: Add a common interface for algorithm objects
diff mbox series

Message ID 20210316101842.18674-3-jeanmichel.hautbois@ideasonboard.com
State Superseded
Headers show
Series
  • [libcamera-devel,RFC,v2,1/3] WIP: ipa: Add a common interface for algorithm objects
Related show

Commit Message

Jean-Michel Hautbois March 16, 2021, 10:18 a.m. UTC
In order to instanciate and use algorithms (AWB, AGC, etc.)
there is a need for a common class to define mandatory methods.

Instead of reinventing the wheel, reuse what Raspberry Pi has done and
adapt to the minimum requirements expected.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
---
 src/ipa/libipa/algorithm.cpp | 25 +++++++++++++++++++++++++
 src/ipa/libipa/algorithm.h   | 29 +++++++++++++++++++++++++++++
 src/ipa/libipa/meson.build   |  4 +++-
 3 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 src/ipa/libipa/algorithm.cpp
 create mode 100644 src/ipa/libipa/algorithm.h

Patch
diff mbox series

diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp
new file mode 100644
index 00000000..24cd0ae2
--- /dev/null
+++ b/src/ipa/libipa/algorithm.cpp
@@ -0,0 +1,25 @@ 
+/* SPDX-License-Identifier: BSD-2-Clause */
+/*
+ * Copyright (C) 2019, Raspberry Pi (Trading) Limited
+ *
+ * algorithm.cpp - ISP control algorithms
+ */
+
+#include "algorithm.h"
+
+/**
+ * \file algorithm.h
+ * \brief Algorithm common interface
+ */
+
+namespace libcamera {
+
+namespace ipa {
+
+void Algorithm::initialise() {}
+
+void Algorithm::process() {}
+
+} /* namespace ipa */
+
+} /* namespace libcamera */
diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h
new file mode 100644
index 00000000..56cd8172
--- /dev/null
+++ b/src/ipa/libipa/algorithm.h
@@ -0,0 +1,29 @@ 
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2019, Raspberry Pi (Trading) Limited
+ *
+ * algorithm.h - ISP control algorithm interface
+ */
+#ifndef __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__
+#define __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__
+
+namespace libcamera {
+
+namespace ipa {
+
+class Algorithm
+{
+public:
+	Algorithm()
+	{
+	}
+	virtual ~Algorithm() = default;
+	virtual void initialise();
+	virtual void process();
+};
+
+} /* namespace ipa */
+
+} /* namespace libcamera */
+
+#endif /* __LIBCAMERA_IPA_LIBIPA_ALGORITHM_H__ */
diff --git a/src/ipa/libipa/meson.build b/src/ipa/libipa/meson.build
index b29ef0f4..585d02a3 100644
--- a/src/ipa/libipa/meson.build
+++ b/src/ipa/libipa/meson.build
@@ -1,13 +1,15 @@ 
 # SPDX-License-Identifier: CC0-1.0
 
 libipa_headers = files([
+  'algorithm.h',
 ])
 
 libipa_sources = files([
+    'algorithm.cpp',
 ])
 
 libipa_includes = include_directories('..')
 
-libipa = static_library('ipa', libipa_sources,
+libipa = static_library('ipa', [libipa_sources, libipa_headers],
                         include_directories : ipa_includes,
                         dependencies : libcamera_dep)