@@ -22,6 +22,53 @@ LOG_DEFINE_CATEGORY(Awb)
namespace ipa {
+/**
+ * \struct awb::Session
+ * \brief Session-wide AWB configuration
+ *
+ * \var awb::Session::enabled
+ * \brief True when AWB processing is enabled for the session
+ */
+
+/**
+ * \struct awb::ActiveState
+ * \brief Active AWB state shared across frames
+ *
+ * \var awb::ActiveState::manual
+ * \brief The most recent manually requested AWB state
+ *
+ * \var awb::ActiveState::automatic
+ * \brief The most recent automatically calculated AWB state
+ *
+ * \var awb::ActiveState::autoEnabled
+ * \brief True when automatic AWB is currently selected
+ */
+
+/**
+ * \struct awb::ActiveState::AwbState
+ * \brief AWB gains and colour temperature for one operating mode
+ *
+ * \var awb::ActiveState::AwbState::gains
+ * \brief The white balance gains for this AWB state
+ *
+ * \var awb::ActiveState::AwbState::temperatureK
+ * \brief The colour temperature for this AWB state, in Kelvin
+ */
+
+/**
+ * \struct awb::FrameContext
+ * \brief Per-frame AWB state applied to a captured frame
+ *
+ * \var awb::FrameContext::gains
+ * \brief The white balance gains applied to the frame
+ *
+ * \var awb::FrameContext::autoEnabled
+ * \brief True when the frame uses automatic AWB
+ *
+ * \var awb::FrameContext::temperatureK
+ * \brief The colour temperature used for the frame, in Kelvin
+ */
+
/**
* \class AwbResult
* \brief The result of an AWB calculation
@@ -20,6 +20,32 @@ namespace libcamera {
namespace ipa {
+namespace awb {
+
+struct Session {
+ bool enabled;
+};
+
+struct ActiveState {
+ struct AwbState {
+ RGB<double> gains;
+ unsigned int temperatureK;
+ };
+
+ AwbState manual;
+ AwbState automatic;
+
+ bool autoEnabled;
+};
+
+struct FrameContext {
+ RGB<double> gains;
+ bool autoEnabled;
+ unsigned int temperatureK;
+};
+
+} /* namespace awb */
+
struct AwbResult {
RGB<double> gains;
double colourTemperature;
@@ -25,6 +25,7 @@
#include "libcamera/internal/vector.h"
#include "libipa/agc_mean_luminance.h"
+#include "libipa/awb.h"
#include "libipa/camera_sensor_helper.h"
#include "libipa/fc_queue.h"
#include "libipa/fixedpoint.h"
@@ -49,15 +50,16 @@ struct IPAHwSettings {
bool compand;
};
+struct RKISP1AwbSession : public ipa::awb::Session {
+ struct rkisp1_cif_isp_window measureWindow;
+};
+
struct IPASessionConfiguration {
struct {
struct rkisp1_cif_isp_window measureWindow;
} agc;
- struct {
- struct rkisp1_cif_isp_window measureWindow;
- bool enabled;
- } awb;
+ struct RKISP1AwbSession awb;
struct {
bool supported;
@@ -103,17 +105,7 @@ struct IPAActiveState {
utils::Duration maxFrameDuration;
} agc;
- struct {
- struct AwbState {
- RGB<double> gains;
- unsigned int temperatureK;
- };
-
- AwbState manual;
- AwbState automatic;
-
- bool autoEnabled;
- } awb;
+ ipa::awb::ActiveState awb;
struct {
Matrix<float, 3, 3> manual;
@@ -175,11 +167,7 @@ struct IPAFrameContext : public FrameContext {
bool autoGainModeChange;
} agc;
- struct {
- RGB<double> gains;
- bool autoEnabled;
- unsigned int temperatureK;
- } awb;
+ ipa::awb::FrameContext awb;
struct {
BrightnessQ brightness;
Expose a common structure for storing Awb Session configuration, Active state and Frame Context data. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- src/ipa/libipa/awb.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++++ src/ipa/libipa/awb.h | 26 ++++++++++++++++++++++++ src/ipa/rkisp1/ipa_context.h | 28 ++++++++------------------ 3 files changed, 81 insertions(+), 20 deletions(-)