After black level handling has been moved to an algorithm module, white balance and the construction of color tables can be moved to algorithm modules too. This time, the moved code is split between stats processing and parameter construction methods. It is also split to two algorithm modules: - White balance computation. - Gamma table computation and color lookup tables construction. While this applies the color gains computed by the white balance algorithm, it is not directly related to white balance. And we may want to modify the color lookup tables in future according to other parameters than just gamma and white balance gains. Gamma table computation and color lookup tables construction could be split to separate algorithms too. But there is no big need for that now so they are kept together for simplicity. This is the only part of the software ISP algorithms that sets the parameters so emitting setIspParams can be moved to prepare() method. A more natural representation of the gains (and black level) would be floating point numbers. This is not done here in order to minimize changes in code movements. It will be addressed in a followup patch. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
33 lines
617 B
C++
33 lines
617 B
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2024, Red Hat Inc.
|
|
*
|
|
* Auto white balance
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "algorithm.h"
|
|
|
|
namespace libcamera {
|
|
|
|
namespace ipa::soft::algorithms {
|
|
|
|
class Awb : public Algorithm
|
|
{
|
|
public:
|
|
Awb() = default;
|
|
~Awb() = default;
|
|
|
|
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
|
|
void process(IPAContext &context,
|
|
const uint32_t frame,
|
|
IPAFrameContext &frameContext,
|
|
const SwIspStats *stats,
|
|
ControlList &metadata) override;
|
|
};
|
|
|
|
} /* namespace ipa::soft::algorithms */
|
|
|
|
} /* namespace libcamera */
|