@@ -35,7 +35,6 @@ static const ControlInfoMap Controls = {
{ &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },
{ &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },
{ &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },
- { &controls::AwbEnable, ControlInfo(false, true) },
{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },
{ &controls::AwbMode, ControlInfo(controls::AwbModeValues) },
{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },
@@ -746,24 +746,6 @@ void IPARPi::queueRequest(const ControlList &controls)
break;
}
- case controls::AWB_ENABLE: {
- RPiController::Algorithm *awb = controller_.GetAlgorithm("awb");
- if (!awb) {
- LOG(IPARPI, Warning)
- << "Could not set AWB_ENABLE - no AWB algorithm";
- break;
- }
-
- if (ctrl.second.get<bool>() == false)
- awb->Pause();
- else
- awb->Resume();
-
- libcameraMetadata_.set(controls::AwbEnable,
- ctrl.second.get<bool>());
- break;
- }
-
case controls::AWB_MODE: {
RPiController::AwbAlgorithm *awb = dynamic_cast<RPiController::AwbAlgorithm *>(
controller_.GetAlgorithm("awb"));
@@ -774,6 +756,15 @@ void IPARPi::queueRequest(const ControlList &controls)
}
int32_t idx = ctrl.second.get<int32_t>();
+
+ if (idx == controls::AwbOff) {
+ awb->Pause();
+ break;
+ }
+
+ if (awb->IsPaused())
+ awb->Resume();
+
if (AwbModeTable.count(idx)) {
awb->SetMode(AwbModeTable.at(idx));
libcameraMetadata_.set(controls::AwbMode, idx);
@@ -229,13 +229,6 @@ controls:
Report an estimate of the current illuminance level in lux. The Lux
control can only be returned in metadata.
- - AwbEnable:
- type: bool
- description: |
- Enable or disable the AWB.
-
- \sa ColourGains
-
# AwbMode needs further attention:
# - Auto-generate max enum value.
# - Better handling of custom types.
@@ -245,29 +238,38 @@ controls:
Specify the range of illuminants to use for the AWB algorithm. The modes
supported are platform specific, and not all modes may be supported.
enum:
- - name: AwbAuto
+ - name: AwbOff
value: 0
+ description: The AWB routune is disabled.
+ - name: AwbAuto
+ value: 1
description: Search over the whole colour temperature range.
- name: AwbIncandescent
- value: 1
- description: Incandescent AWB lamp mode.
- - name: AwbTungsten
value: 2
- description: Tungsten AWB lamp mode.
+ description: Incandescent AWB lamp mode.
- name: AwbFluorescent
value: 3
description: Fluorescent AWB lamp mode.
- - name: AwbIndoor
+ - name: AwbWarmFluorescent
value: 4
- description: Indoor AWB lighting mode.
+ description: Warm fluorescent AWB lamp mode.
- name: AwbDaylight
value: 5
description: Daylight AWB lighting mode.
- name: AwbCloudy
value: 6
description: Cloudy AWB lighting mode.
- - name: AwbCustom
+ - name: AwbTwilight
value: 7
+ description: Twilight AWB lamp mode.
+ - name: AwbTungsten
+ value: 8
+ description: Tungsten AWB lamp mode.
+ - name: AwbIndoor
+ value: 9
+ description: Indoor AWB lighting mode.
+ - name: AwbCustom
+ value: 10
description: Custom AWB mode.
- AwbLocked:
@@ -143,10 +143,10 @@ protected:
* Attempt to set an invalid control and verify that the
* operation failed.
*/
- list.set(controls::AwbEnable, true);
+ list.set(controls::AwbMode, true);
- if (list.contains(controls::AwbEnable)) {
- cout << "List shouldn't contain AwbEnable control" << endl;
+ if (list.contains(controls::AwbMode)) {
+ cout << "List shouldn't contain AwbMode control" << endl;
return TestFail;
}
Previously it was possible to have AwbEnable set to false, yet have AwbMode on anything. This caused a confusion situation, so merge the two into AwbMode. While at it, pull in the android AWB modes. Adjust the previous users of AwbEnable accordingly. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- Changes in v3: - resume raspberrypi awb on any non-off mode --- include/libcamera/ipa/raspberrypi.h | 1 - src/ipa/raspberrypi/raspberrypi.cpp | 27 ++++++++---------------- src/libcamera/control_ids.yaml | 32 +++++++++++++++-------------- test/controls/control_list.cpp | 6 +++--- 4 files changed, 29 insertions(+), 37 deletions(-)