[libcamera-devel,RFC,2/2] DNI: pipeline: ipu3: Set Sharpness control and control info
diff mbox series

Message ID 20210823094806.1434280-2-paul.elder@ideasonboard.com
State Superseded
Delegated to: Paul Elder
Headers show
Series
  • [libcamera-devel,RFC,1/2] android: Plumb Sharpness control into EDGE_MODE
Related show

Commit Message

Paul Elder Aug. 23, 2021, 9:48 a.m. UTC
This is to demonstrate reporting and setting Sharpness on ipu3.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index a98d7eff..e90659e3 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -50,6 +50,7 @@  static constexpr unsigned int IMGU_OUTPUT_HEIGHT_MARGIN = 32;
 static constexpr Size IPU3ViewfinderSize(1280, 720);
 
 static const ControlInfoMap::Map IPU3Controls = {
+	{ &controls::Sharpness, ControlInfo(0.0f, 1.0f, 0.0f) },
 	{ &controls::draft::PipelineDepth, ControlInfo(2, 3) },
 };
 
@@ -1299,6 +1300,12 @@  void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer)
 		cropRegion_ = request->controls().get(controls::ScalerCrop);
 	request->metadata().set(controls::ScalerCrop, cropRegion_);
 
+	/* \todo Actually apply sharpness. */
+	if (request->controls().contains(controls::Sharpness)) {
+		float val = request->controls().get<float>(controls::Sharpness);
+		request->metadata().set(controls::Sharpness, val);
+	}
+
 	if (frameInfos_.tryComplete(info))
 		pipe()->completeRequest(request);
 }