Files
external_libcamera/src/ipa/libipa/awb_grey.h
T
Stefan Klug c699d26573 libipa: awb: Make result of gainsFromColourTemp optional
In the grey world AWB case, if no colour gains are contained in the
tuning file, the colour gains get reset to 1 when the colour temperature
is set manually. This is unexpected and undesirable. Allow the
gainsFromColourTemp() function to return a std::nullopt to handle that
case.

While at it, remove an unnecessary import from rkisp1/algorithms/awb.h.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2025-05-20 11:20:08 +02:00

37 lines
703 B
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2024 Ideas on Board Oy
*
* AWB grey world algorithm
*/
#pragma once
#include <optional>
#include "libcamera/internal/vector.h"
#include "awb.h"
#include "interpolator.h"
namespace libcamera {
namespace ipa {
class AwbGrey : public AwbAlgorithm
{
public:
AwbGrey() = default;
int init(const YamlObject &tuningData) override;
AwbResult calculateAwb(const AwbStats &stats, unsigned int lux) override;
std::optional<RGB<double>> gainsFromColourTemperature(double colourTemperature) override;
private:
std::optional<Interpolator<Vector<double, 2>>> colourGainCurve_;
};
} /* namespace ipa */
} /* namespace libcamera */