libcamera: ipa: raspberrypi: awb: Add SwitchMode method to output AWB status
The Awb class now implements a SwitchMode method which outputs its AwbStatus for other algorithms to read, should they be interested. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
f185a16833
commit
23ada683db
2 changed files with 15 additions and 0 deletions
|
@ -179,6 +179,20 @@ void Awb::SetManualGains(double manual_r, double manual_b)
|
||||||
manual_b_ = manual_b;
|
manual_b_ = manual_b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Awb::SwitchMode([[maybe_unused]] CameraMode const &camera_mode,
|
||||||
|
Metadata *metadata)
|
||||||
|
{
|
||||||
|
// If fixed colour gains have been set, we should let other algorithms
|
||||||
|
// know by writing it into the image metadata.
|
||||||
|
if (manual_r_ != 0.0 && manual_b_ != 0.0) {
|
||||||
|
prev_sync_results_.gain_r = manual_r_;
|
||||||
|
prev_sync_results_.gain_g = 1.0;
|
||||||
|
prev_sync_results_.gain_b = manual_b_;
|
||||||
|
sync_results_ = prev_sync_results_;
|
||||||
|
}
|
||||||
|
metadata->Set("awb.status", prev_sync_results_);
|
||||||
|
}
|
||||||
|
|
||||||
void Awb::fetchAsyncResults()
|
void Awb::fetchAsyncResults()
|
||||||
{
|
{
|
||||||
RPI_LOG("Fetch AWB results");
|
RPI_LOG("Fetch AWB results");
|
||||||
|
|
|
@ -84,6 +84,7 @@ public:
|
||||||
void Read(boost::property_tree::ptree const ¶ms) override;
|
void Read(boost::property_tree::ptree const ¶ms) override;
|
||||||
void SetMode(std::string const &name) override;
|
void SetMode(std::string const &name) override;
|
||||||
void SetManualGains(double manual_r, double manual_b) override;
|
void SetManualGains(double manual_r, double manual_b) override;
|
||||||
|
void SwitchMode(CameraMode const &camera_mode, Metadata *metadata) override;
|
||||||
void Prepare(Metadata *image_metadata) override;
|
void Prepare(Metadata *image_metadata) override;
|
||||||
void Process(StatisticsPtr &stats, Metadata *image_metadata) override;
|
void Process(StatisticsPtr &stats, Metadata *image_metadata) override;
|
||||||
struct RGB {
|
struct RGB {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue