From afd2a5dac59a06c6897bdf7a3a1f35743192b608 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Wed, 27 Jul 2022 09:55:20 +0100 Subject: ipa: raspberrypi: Rename header files from *.hpp to *.h As per the libcamera coding guidelines, rename all .hpp header files to .h. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/agc.hpp | 141 ----------------------------- 1 file changed, 141 deletions(-) delete mode 100644 src/ipa/raspberrypi/controller/rpi/agc.hpp (limited to 'src/ipa/raspberrypi/controller/rpi/agc.hpp') diff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp deleted file mode 100644 index c2d68b60..00000000 --- a/src/ipa/raspberrypi/controller/rpi/agc.hpp +++ /dev/null @@ -1,141 +0,0 @@ -/* SPDX-License-Identifier: BSD-2-Clause */ -/* - * Copyright (C) 2019, Raspberry Pi (Trading) Limited - * - * agc.hpp - AGC/AEC control algorithm - */ -#pragma once - -#include -#include - -#include - -#include "../agc_algorithm.hpp" -#include "../agc_status.h" -#include "../pwl.hpp" - -/* This is our implementation of AGC. */ - -/* - * This is the number actually set up by the firmware, not the maximum possible - * number (which is 16). - */ - -#define AGC_STATS_SIZE 15 - -namespace RPiController { - -struct AgcMeteringMode { - double weights[AGC_STATS_SIZE]; - void read(boost::property_tree::ptree const ¶ms); -}; - -struct AgcExposureMode { - std::vector shutter; - std::vector gain; - void read(boost::property_tree::ptree const ¶ms); -}; - -struct AgcConstraint { - enum class Bound { LOWER = 0, UPPER = 1 }; - Bound bound; - double qLo; - double qHi; - Pwl yTarget; - void read(boost::property_tree::ptree const ¶ms); -}; - -typedef std::vector AgcConstraintMode; - -struct AgcConfig { - void read(boost::property_tree::ptree const ¶ms); - std::map meteringModes; - std::map exposureModes; - std::map constraintModes; - Pwl yTarget; - double speed; - uint16_t startupFrames; - unsigned int convergenceFrames; - double maxChange; - double minChange; - double fastReduceThreshold; - double speedUpThreshold; - std::string defaultMeteringMode; - std::string defaultExposureMode; - std::string defaultConstraintMode; - double baseEv; - libcamera::utils::Duration defaultExposureTime; - double defaultAnalogueGain; -}; - -class Agc : public AgcAlgorithm -{ -public: - Agc(Controller *controller); - char const *name() const override; - void read(boost::property_tree::ptree const ¶ms) override; - /* AGC handles "pausing" for itself. */ - bool isPaused() const override; - void pause() override; - void resume() override; - unsigned int getConvergenceFrames() const override; - void setEv(double ev) override; - void setFlickerPeriod(libcamera::utils::Duration flickerPeriod) override; - void setMaxShutter(libcamera::utils::Duration maxShutter) override; - void setFixedShutter(libcamera::utils::Duration fixedShutter) override; - void setFixedAnalogueGain(double fixedAnalogueGain) override; - void setMeteringMode(std::string const &meteringModeName) override; - void setExposureMode(std::string const &exposureModeName) override; - void setConstraintMode(std::string const &contraintModeName) override; - void switchMode(CameraMode const &cameraMode, Metadata *metadata) override; - void prepare(Metadata *imageMetadata) override; - void process(StatisticsPtr &stats, Metadata *imageMetadata) override; - -private: - void updateLockStatus(DeviceStatus const &deviceStatus); - AgcConfig config_; - void housekeepConfig(); - void fetchCurrentExposure(Metadata *imageMetadata); - void fetchAwbStatus(Metadata *imageMetadata); - void computeGain(bcm2835_isp_stats *statistics, Metadata *imageMetadata, - double &gain, double &targetY); - void computeTargetExposure(double gain); - bool applyDigitalGain(double gain, double targetY); - void filterExposure(bool desaturate); - void divideUpExposure(); - void writeAndFinish(Metadata *imageMetadata, bool desaturate); - libcamera::utils::Duration clipShutter(libcamera::utils::Duration shutter); - AgcMeteringMode *meteringMode_; - AgcExposureMode *exposureMode_; - AgcConstraintMode *constraintMode_; - uint64_t frameCount_; - AwbStatus awb_; - struct ExposureValues { - ExposureValues(); - - libcamera::utils::Duration shutter; - double analogueGain; - libcamera::utils::Duration totalExposure; - libcamera::utils::Duration totalExposureNoDG; /* without digital gain */ - }; - ExposureValues current_; /* values for the current frame */ - ExposureValues target_; /* calculate the values we want here */ - ExposureValues filtered_; /* these values are filtered towards target */ - AgcStatus status_; - int lockCount_; - DeviceStatus lastDeviceStatus_; - libcamera::utils::Duration lastTargetExposure_; - double lastSensitivity_; /* sensitivity of the previous camera mode */ - /* Below here the "settings" that applications can change. */ - std::string meteringModeName_; - std::string exposureModeName_; - std::string constraintModeName_; - double ev_; - libcamera::utils::Duration flickerPeriod_; - libcamera::utils::Duration maxShutter_; - libcamera::utils::Duration fixedShutter_; - double fixedAnalogueGain_; -}; - -} /* namespace RPiController */ -- cgit v1.2.1