ipa: raspberrypi: Add an operator<< to struct DeviceStatus
Add an operator<< overload to log all fields in DeviceStatus, and remove the manual logging statements in the IPA and CamHelper. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
df8cafaf87
commit
f24d83720f
@@ -0,0 +1,20 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
/*
|
||||
* Copyright (C) 2021, Raspberry Pi (Trading) Limited
|
||||
*
|
||||
* device_status.cpp - device (image sensor) status
|
||||
*/
|
||||
#include "device_status.h"
|
||||
|
||||
using namespace libcamera; /* for the Duration operator<< overload */
|
||||
|
||||
std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)
|
||||
{
|
||||
out << "Exposure: " << d.shutter_speed
|
||||
<< " Gain: " << d.analogue_gain
|
||||
<< " Aperture: " << d.aperture
|
||||
<< " Lens: " << d.lens_position
|
||||
<< " Flash: " << d.flash_intensity;
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <libcamera/base/utils.h>
|
||||
|
||||
/*
|
||||
@@ -20,6 +22,8 @@ struct DeviceStatus {
|
||||
{
|
||||
}
|
||||
|
||||
friend std::ostream &operator<<(std::ostream &out, const DeviceStatus &d);
|
||||
|
||||
/* time shutter is open */
|
||||
libcamera::utils::Duration shutter_speed;
|
||||
double analogue_gain;
|
||||
|
||||
Reference in New Issue
Block a user