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:
Naushir Patuck 2021-07-12 11:02:04 +01:00 committed by Laurent Pinchart
parent df8cafaf87
commit f24d83720f
5 changed files with 27 additions and 8 deletions

View file

@ -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;
}